asp.net ajax控件工具包3.5的配置问题

发布于 2024-09-16 06:39:46 字数 3609 浏览 6 评论 0原文

我已经正确安装了控件工具包(应用程序的 bin 文件夹中的 dll,能够将控件添加到 VS 中的工具箱)

我的问题是没有一个控件对我有用,我几乎可以肯定我在设置中缺少了一些东西。

例如:

Accordion Pane: 标题已呈现,但窗格不可单击(因此无法展开)

ComboBox: 控件已呈现,但列表项未显示(我尝试过静态列表项和数据绑定项)

请参阅下面的代码。

Other Info

Windows Server 2008 64 bit
VS 2008
.NET 3.5

手风琴

<%@ Page Language="C#" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Using the AJAX Control Toolkit in ASP.NET 3.5</title>
</head>
<body>

<form id="form1" runat="server">

<asp:ScriptManager ID="ScriptManager1" runat="server" />

Password: <asp:TextBox ID="TextBox1" runat="server" TextMode="Password" /><br />
<cc1:PasswordStrength ID="TextBox1_PasswordStrength" runat="server"
Enabled="True" TargetControlID="TextBox1">
</cc1:PasswordStrength>
<cc1:DropShadowExtender ID="TextBox1_DropShadowExtender" runat="server"
Enabled="True" TargetControlID="TextBox1">
</cc1:DropShadowExtender>
<br />
<br />
<cc1:Accordion ID="Accordion1" runat="server" RequireOpenedPane="false">
<Panes>
<cc1:AccordionPane ID="AccPane1" runat="server">
<Header>This is Pane 1.</Header>
<Content><br />This is pane one content.</Content>
</cc1:AccordionPane>
<cc1:AccordionPane ID="AccPane2" runat="server">
<Header>This is Pane 2.</Header>
<Content><br />This is pane two content.</Content>
</cc1:AccordionPane>
<cc1:AccordionPane ID="AccPane3" runat="server">
<Header>This is Pane 3.</Header>
<Content><br />This is pane three content.</Content>
</cc1:AccordionPane>
</Panes>
</cc1:Accordion>
</form>

</body>
</html> 

组合框

<%@ Page Language="C#" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        lblSelection.Text = "You picked " + ComboBox1.SelectedItem.Text;        
    }
</script>


<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>Static</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server" />

        Describe how spicy you like your food:
        <br />
        <cc1:ComboBox ID="ComboBox1" runat="server" RenderMode="Block">
            <asp:ListItem Text="Mi65y6yld" Value="0" />
            <asp:ListItem Text="Medium" Value="1" />
            <asp:ListItem Text="Hot" Value="2" />
        </cc1:ComboBox>

        <asp:Button
            ID="btnSubmit"
            Text="Submit"
            Runat="server" OnClick="btnSubmit_Click" />

        <hr />
        <asp:Label
            ID="lblSelection"
            Runat="server" />

    </div>
    </form>
</body>
</html>

I have the control toolkit installed properly (dll in the application's bin folder, able to add controls to toolbox in VS)

My problem is that none of the controls work for me, I'm almost certain that I'm missing something in my setup.

For example:

Accordion Pane: Headers are rendered but the panes aren't clickable (and thus don't expand)

ComboBox: The control is rendered but list items are not displayed (I've tried with static list items and databound items)

See code below.

Other Info

Windows Server 2008 64 bit
VS 2008
.NET 3.5

ACCORDION

<%@ Page Language="C#" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Using the AJAX Control Toolkit in ASP.NET 3.5</title>
</head>
<body>

<form id="form1" runat="server">

<asp:ScriptManager ID="ScriptManager1" runat="server" />

Password: <asp:TextBox ID="TextBox1" runat="server" TextMode="Password" /><br />
<cc1:PasswordStrength ID="TextBox1_PasswordStrength" runat="server"
Enabled="True" TargetControlID="TextBox1">
</cc1:PasswordStrength>
<cc1:DropShadowExtender ID="TextBox1_DropShadowExtender" runat="server"
Enabled="True" TargetControlID="TextBox1">
</cc1:DropShadowExtender>
<br />
<br />
<cc1:Accordion ID="Accordion1" runat="server" RequireOpenedPane="false">
<Panes>
<cc1:AccordionPane ID="AccPane1" runat="server">
<Header>This is Pane 1.</Header>
<Content><br />This is pane one content.</Content>
</cc1:AccordionPane>
<cc1:AccordionPane ID="AccPane2" runat="server">
<Header>This is Pane 2.</Header>
<Content><br />This is pane two content.</Content>
</cc1:AccordionPane>
<cc1:AccordionPane ID="AccPane3" runat="server">
<Header>This is Pane 3.</Header>
<Content><br />This is pane three content.</Content>
</cc1:AccordionPane>
</Panes>
</cc1:Accordion>
</form>

</body>
</html> 

ComboBox

<%@ Page Language="C#" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        lblSelection.Text = "You picked " + ComboBox1.SelectedItem.Text;        
    }
</script>


<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>Static</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server" />

        Describe how spicy you like your food:
        <br />
        <cc1:ComboBox ID="ComboBox1" runat="server" RenderMode="Block">
            <asp:ListItem Text="Mi65y6yld" Value="0" />
            <asp:ListItem Text="Medium" Value="1" />
            <asp:ListItem Text="Hot" Value="2" />
        </cc1:ComboBox>

        <asp:Button
            ID="btnSubmit"
            Text="Submit"
            Runat="server" OnClick="btnSubmit_Click" />

        <hr />
        <asp:Label
            ID="lblSelection"
            Runat="server" />

    </div>
    </form>
</body>
</html>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

怼怹恏 2024-09-23 06:39:46

不好的是,

我必须将这些脚本引用添加到我的脚本管理器中:

<Scripts>
                <asp:ScriptReference Name="MicrosoftAjax.js" Path="http://ajax.microsoft.com/ajax/beta/0911/MicrosoftAjax.js" />
                <asp:ScriptReference ScriptMode="Inherit" Path="http://ajax.microsoft.com/ajax/beta/0911/MicrosoftAjaxTemplates.js" />
                <asp:ScriptReference ScriptMode="Inherit" Path="http://ajax.microsoft.com/ajax/beta/0911/MicrosoftAjaxAdoNet.js" />
                <asp:ScriptReference ScriptMode="Inherit" Path="http://ajax.microsoft.com/ajax/beta/0911/MicrosoftAjaxDataContext.js" />
            </Scripts>

My bad,

I had to add these script references to my script manager:

<Scripts>
                <asp:ScriptReference Name="MicrosoftAjax.js" Path="http://ajax.microsoft.com/ajax/beta/0911/MicrosoftAjax.js" />
                <asp:ScriptReference ScriptMode="Inherit" Path="http://ajax.microsoft.com/ajax/beta/0911/MicrosoftAjaxTemplates.js" />
                <asp:ScriptReference ScriptMode="Inherit" Path="http://ajax.microsoft.com/ajax/beta/0911/MicrosoftAjaxAdoNet.js" />
                <asp:ScriptReference ScriptMode="Inherit" Path="http://ajax.microsoft.com/ajax/beta/0911/MicrosoftAjaxDataContext.js" />
            </Scripts>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文