Force a postback

cpopham

Junior Contributor
Joined
Feb 18, 2004
Messages
273
I thought that if I had a checkbox, when it is clicked, it should postbaclk to the server. It is not working like that though, when you press the update button, then the checkbox is checked and the update to the form view is changed according to the checkbox. I want the change to take effect when the checkbox is clicked on like a windows app. Any ideas?

Thanks, Chester
 
You might want to look in the properties area when you have the check box in focus and check to see what the AutoPostBack is set to. I am just starting to work with ASP.NET and C#, and noticed that is an option you have when you place a checkbox on the webform.

Naturally though I'd be careful about doing this since when the box changes you take a hit back to the webserver to update things.

Hope this helps out, and like I said, just working on learning this stuff myself so if I have spoken incorrectly those more knowledgable will have to let me know.
 
irasmith said:
You might want to look in the properties area when you have the check box in focus and check to see what the AutoPostBack is set to. I am just starting to work with ASP.NET and C#, and noticed that is an option you have when you place a checkbox on the webform.

Naturally though I'd be careful about doing this since when the box changes you take a hit back to the webserver to update things.

Hope this helps out, and like I said, just working on learning this stuff myself so if I have spoken incorrectly those more knowledgable will have to let me know.
i'm not sure where your code is, but after a postback, what you want it to do then should go back to the page_load sub. it's really confusing, but try that.
 
Thanks, I have it working now.... I am still learing ASP .net and am reading up on it.

Chester
 
egdotnet said:
i'm not sure where your code is, but after a postback, what you want it to do then should go back to the page_load sub. it's really confusing, but try that.

everytime you post back it automatically uses the page_load event, so you don't have to do anything special (except probably add a "if not page.ispostback then" if statement to the top of the sub)
 
Back
Top