User control not retaining property values
I have a very simple user control with 5 radio buttons on it, and 3 properties (ID, RatingSetID, and Rating). On the initial load of the 开发者_运维技巧page they are on, the code acquires data and places the data into the 3 properties. However, when the submit button is clicked the page reloads and the 3 properties get reset to 0, they are in the !IsPostBack as well. I know I am missing something simple.
Can anyone help?
The usercontrol might be reloaded when postback if you load this control on the fly
The user control get reload when the postback happens. You can place it into an UpdatePanel it could solve your problem.
精彩评论