首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >asp.net内容页的CascadingDropDown有问题

asp.net内容页的CascadingDropDown有问题
EN

Stack Overflow用户
提问于 2010-03-17 02:58:21
回答 2查看 890关注 0票数 0

我有一个带有更新面板的asp.net内容页面,带有ajax扩展器的asp.net控件,还有带有事件点击的asp.net按钮。除了一个案例之外,一切都很正常。我有3个带CascadingDropDown扩展器的DropDownList。当我在没有从DropDownLists中选择任何东西的情况下点击按钮,然后点击按钮,事件点击将正常工作,但是如果我选择了任何东西,当我点击按钮时,我的页面将会响应。

我已经为点击按钮添加了触发器。

有什么我应该检查来解决这个问题的吗?

下面是我的代码:

代码语言:javascript
复制
<%@ Page Title="" Language="C#" MasterPageFile="~/Master.Master" AutoEventWireup="true" CodeBehind="WebForm2.aspx.cs" Inherits="IMAM_APPLICATION.WebForm2" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">
  <asp:UpdatePanel ID="UPDDL" runat="server">
     <ContentTemplate>
     <asp:Panel ID="PDDL" runat="server">
      <asp:DropDownList ID="cmbWorkField" runat="server" Style="top: 41px; left: 126px;
                    position: absolute; height: 22px; width: 126px">


                </asp:DropDownList>

                <asp:DropDownList runat="server" ID="cmbOccupation" Style="top: 77px; left: 127px;
                    position: absolute; height: 22px; width: 77px">

                </asp:DropDownList>
                <asp:DropDownList ID="cmbSubOccup" runat="server"
                    style="position:absolute; top: 116px; left: 126px;">

                </asp:DropDownList>

                <cc1:CascadingDropDown ID="cmbWorkField_CascadingDropDown" runat="server"
                    TargetControlID="cmbWorkField"
                    Category="WorkField"  
                    LoadingText="Please Wait ..."
                    PromptText="Select Wor kField ..."
                    ServiceMethod="GetWorkField"
                    ServicePath="ServiceTags.asmx">
                </cc1:CascadingDropDown>

                <cc1:CascadingDropDown ID="cmbOccupation_CascadingDropDown" runat="server"

                    TargetControlID="cmbOccupation"
                     Category="Occup"
                    LoadingText="Please wait..."
                    PromptText="Select Occup ..."
                    ServiceMethod="GetOccup"
                    ServicePath="ServiceTags.asmx"
                    ParentControlID="cmbWorkField">
                </cc1:CascadingDropDown>
                <cc1:CascadingDropDown ID="cmbSubOccup_CascadingDropDown" runat="server"
                    Category="SubOccup"
                    Enabled="True"
                     LoadingText="Please Wait..."
                    ParentControlID="cmbOccupation"
                    PromptText="Select Sub Occup"
                    ServiceMethod="GetSubOccup"
                    ServicePath="ServiceTags.asmx"
                    TargetControlID="cmbSubOccup">
                </cc1:CascadingDropDown>
                </asp:Panel>
         <asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />
         <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
     </ContentTemplate>

      <Triggers>
          <asp:AsyncPostBackTrigger ControlID="Button1" EventName="Click" />
      </Triggers>

     </asp:UpdatePanel>


</asp:Content>

........................

here is the code behind:

....................................................

protected void Button1_Click(object sender, EventArgs e)
        {
            Label1.Text = "you click me";
        }
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2010-03-22 11:09:37

我能够解决这个问题。

我添加的是删除更新面板,并将页面的EnableEventValidation=设置为“False”。

票数 0
EN

Stack Overflow用户

发布于 2010-04-04 23:44:46

您看到的问题记录在Codeplex上。请参阅jlewicki的帖子,了解其他两种不需要关闭EventValidation的可能解决方案。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/2457241

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档