简体   繁体   English

ASP.NET:回发完成后,我的html元素重复出现

[英]ASP.NET : my html element repeated after my postback finish

i have an asp web page and my page contains to RadCombobox. 我有一个ASP网页,我的页面包含到RadCombobox。 for first drop down i set item_requested method (when the user click on it and select the theater name.it has a post back and after post back the second drop down fill with sans numbers ). 对于第一个下拉菜单,我设置了item_requested方法(当用户单击它并选择剧院名称时。它有一个回发,而在回发后,第二个下拉菜单用sans数字填充)。
my problem is here: 我的问题在这里:
after page post back the second field set duplicate in my page. 页面发回后,第二个字段在我的页面中设置重复。 in these pictures you can see that. 在这些图片中,您可以看到。
Before post back: 回发之前:
在此处输入图片说明

the second image :(After postback the second fielset repeated) 第二张图片:(回发后,重复第二张图片集)
在此处输入图片说明

Note : 注意事项
all of my controls in update panel. 我所有的控件都在更新面板中。 after i remove update panel from my page i doesn't happen again.Do you know the reason ? 从页面上删除更新面板后,我不再发生。您知道原因吗? :[ :[

You probably have some logic where you are adding this component. 您可能在添加此组件的地方有些逻辑。 Try to check IsPostBack before adding the component to the page. 在将组件添加到页面之前,请尝试检查IsPostBack。 Just like that: 就像这样:

if (!IsPostBack) 
{
    //dynamically add component
}
        protected void Page_Load(object sender, EventArgs e)
    {
        if (IsPostBack == false)
        {
            // ASPX C#
        }
    }

ASP ................... IM NOT GOOD AT ASP ASP ................... IM在ASP上不佳

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM