Preventing a dynamic user control from loading twicehttp://forums.asp.net/t/316833.aspx/1?Preventing+a+dynamic+user+control+from+loading+twiceFri, 22 Aug 2003 15:35:09 -0400316833316833http://forums.asp.net/p/316833/316833.aspx/1?Preventing+a+dynamic+user+control+from+loading+twicePreventing a dynamic user control from loading twice I have a user control thats dynamically loaded when someone click a linkbutton. In order to maintain the viewstate, I declare a Viewstate("ID") and hold a value. If the page is posted back, I do If..end if statement to look for the Viewstate("ID"), if found. I send it to the method to load the user control. Now if I click on another linkbutton in the main aspx page, it loads the user control again with the new value set ot the viewstate("ID"). But in fact it loads another user control and I now have 2 user controls loaded even though only 1 is showing. I can tell because my user control has a linkbutton and when its loaded the 1st time, it has a value of clt4_Submit and when I select another button in the main page, the user control is reloaded and the buttoin within it is now clt5_Submit, if I click the linkbutton in the user control, the user control is reloaded from viewstate, but the linkbutton inside the user control is reset correctly back to clt4_Submit. What can I do to prevent the user control from loading twice, I have my placeholder cleared on the method that loads it. 2003-08-22T15:33:44-04:00