|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
ViewState for User Controls??
I just wrote a User Control that populates a drop Down from a Database.<br><br>I have enableviewstate=true for BOTH the user control AND the page<br>I drag the user control on. <br><br>PostBack is also set to true on the User control.<br><br>Every time an item is selected from the drop down, the list keeps growing<br>with duplicates, i.e. 8 items to 16 to 32 etc, etc.<br><br>If I turn OFF enableview state for either the User Control OR the Form the<br>control is on, Items DO NOT duplicate BUT the selection does not stay after<br>post back.<br><br>I'm sure the solution is easy
Any help would be greatly appreciated.<br><br>David Bernett |
|
#2
|
|||
|
|||
|
I'm such an Idiot..................<br><br>By wrapping <br><br>If Page.IsPostBack = False Around the <br>user control routine fixed the problem!<br><br>Sorry for the post<br><br>David Bernett
|
|
#3
|
|||
|
|||
|
No need to appologize for the post, chances are there are at least 100 other people out there with the same issue.<p> </p><p><hr size="1" width="50%" align="left" />dotNetBB Forum Developer<br><b><i>Building A Better Community, One Post At A Time</i></b><br><a href="http://www.dotnetbb.com" target="_blank">www.dotnetbb.com</a></p>
|
![]() |
| Viewing: ASP Free Forums > Programming > .NET Development > ViewState for User Controls?? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|