Reputation: 247
My webpart is programmed with C# and shall show a form and a checkbox. If the user click on it the OnCheckedChanged-Event must trigger (I think so). But the webpart send the dates not at this time to server. With <asp:checkbox ... AutoPostBack = "true" ... />
it works. The problem is that the other form fields are thereby extinguished/reset and I don´t want cache the data. What can I do? It is reasonable evaluate the checkbox on client-site? Or can I trigger the OnCheckedChanged-Event by an other way?
thanks.
Upvotes: 0
Views: 593
Reputation: 15630
I think this is occurring because of postback . You must check the Ispostback property on page load in order to avoid this type of issues. Also this helps you to prevent unwanted function calls when you do postback. Also check the function you are calling in page load.
Also there is a chance that you may set ViewState="false"
in html part. So that the controls doesn't have any value after the postback. Make sure that you are enabling the ViewState for your controls.
Just have a look at these urls. or paste you html as well as Code in Page Load event .
Kindly provide some more details.
Upvotes: 1