Last post Apr 05, 2016 08:56 AM by Yohann Lu
Apr 02, 2016 08:23 PM|tuf33757|LINK
I hope I have posted this in the right area. I am having an issue that is driving my team insane with user controls. We are currently using 2 user controls as section for a form . Lets call them UCA and UCB. On the form there are 2 sets, UCA1 and UCA2
then UCB1 and UCB2. When trying to access the data entered into the controls we are loosing the data in UCA2 and UCB2. I have tried to set EnableViewState to false as suggested by a different forum, but that did not work.
In the code behind we are pulling the data from UCA1, or UCB1 first, depending on selection from the user, and then UCA2 or UCB2. When we go to pull this data the textboxes are all empty.
Any help or explanation would be great.
Apr 05, 2016 08:56 AM|Yohann Lu|LINK
In the code behind we are pulling the data from UCA1, or UCB1 first, depending on selection from the user, and then UCA2 or UCB2. When we go to pull this data the textboxes are all empty
I think maybe when you post back UCA1, or UCB1 first, then UCA2 or UCB2 lost all data that you need. you can save all data that you need in ViewState.
You can refer the following information, I hope it is help for you.
1: ASP.NET loses data from form after postback:
2: How to maintain dynamic control events, data during postback in asp.net:
You can also provide some detailed error messages or codes for us better reproduce your problem.