简体   繁体   中英

ASP.NET : my html element repeated after my postback finish

i have an asp web page and my page contains to 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 ).
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. 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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