label viewstate not preserved
-
i see many people had posted this problem. can some one please help. i have a user control with asp:label on it. the label loses its text on postback it is now a whole month i am trying to find a work around but no success.
-
i see many people had posted this problem. can some one please help. i have a user control with asp:label on it. the label loses its text on postback it is now a whole month i am trying to find a work around but no success.
hassanmohamed wrote:
i see many people had posted this problem.
Did they get any answers?
hassanmohamed wrote:
it is now a whole month i am trying to find a work around but no success.
That's sad, man.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon "Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
-
i see many people had posted this problem. can some one please help. i have a user control with asp:label on it. the label loses its text on postback it is now a whole month i am trying to find a work around but no success.
Are you re-binding the control every time you postback? Where are you setting the text? Can you post a few (smallish) code snippets.
-
i see many people had posted this problem. can some one please help. i have a user control with asp:label on it. the label loses its text on postback it is now a whole month i am trying to find a work around but no success.
Looks like you are adding label dynamically. ASP.NET won't maintain viewstate for dynamic controls created after viewstate is loaded.
Navaneeth How to use google | Ask smart questions
-
i see many people had posted this problem. can some one please help. i have a user control with asp:label on it. the label loses its text on postback it is now a whole month i am trying to find a work around but no success.
Check your label for following scenarios : 1. Is the property EnableViewState is set to false for the label control or its parent control 2. Is the control is being dynamically added to your page. if yes recreate the control on "Init" 3. Binding a "Null" or "Empty" value to label on postbacks