- First of all open visual studio and create a web application DissectDoPostBack (you can give any name to your web application).
- On the default.aspx page add a button control.
- Run the application.
- You can see a button which have added in the web form at design time.
- Right click on the web browser.
- Click View Source.Click to Enlarge
- Now add a textbox in the form.
- Right click on the browser window and click View SourceClick to Enlarge
- Now add an attribute AutoPostBack = "true" in the textbox.
- Again run the application.
- Click on the textbox and type something in it. You can observe the submission of page validates AutoPostBack = "true" Fair enough.
- Now again right click on the browser and click View SourceClick to Enlarge
- On the page load add the following code
- Run the application
- Now in the ClickButton method add following
- Now again run the application.
- Click on the button.