Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. How do you use a single Web form to gather and process submitted data. 2. Exp

ID: 664656 • Letter: 1

Question

1. How do you use a single Web form to gather and process submitted data.

2.      Explain the two ways that ASP.NET framework submits data from the controls provided on a Web form to the server.

3.       What is code-behind page and why it is used in the ASP.NET web site programming.

4.       When is a post back event initiated?

5.       Explain how ASP.NET retains control values across post backs to the server?

6.       Explain tree different ways you could disable the ViewState in ASP.NET.

7.       Give two reasons to use ASP.NET a server control such as <asp:img> instead of their HTML tags such as <img>.

8.       As you learned ASP.NET allows the use of server controls as well as HTML controls. HTML controls are in many ways similar to the simple server controls. What are the differences of the two? When do you use simple server controls and when should we use HTML controls instead?

9.       What are the differences between the HEAD and GET HTTP methods?

10. What ate the differences between the POST and GET HTTP methods?

Explanation / Answer

1)

To gather and process submitted data using a single web form , a web form should submit the data to itself, because user cannot submit the web from to another URL.

This can be done by clicking the submit button. When the submit button is clicked, the data will be posted back to the same web page itself. This process is called post back. Also view state determines whether the data is posted back to the web from or not.

Therefore, there is no need to retrieve the form values, because post back itself gathers the data.

2)

Web forms are used to submit the user data to the sever. Server processes this data and submits the result to the client.

One way to submitting the information from web form to server is post back. Post back is nothing but posting the web from to the web server. Post back is initiated when a control event is occurred. For example if the user clicks on a button control, the web form that contains the button is posted back to the server.

Even submit button is used to submit data from web form to the web server.

3)

ASP.NET provides page-behind page method. In page-behind method web forms and controls are placed in one file with extension .aspx and the programing code, properties associated with the .aspx file are placed in another file. The file contains the programming code is called code-behind page. The languages like C# or VB are used to place programming code in code-behind page.

4)

Whenever the user interacts with the server through ASP.NET sever controls. Whenever the web form is submitted to server, the server control event will be occurred. Each time the server control event is executed, post back is initialled.

5)

ASP.NET is uses view state property to retain the values of the controls or the states of the controls across the post backs. There is a hidden form filed, _VIEWSTSTE, which is a string that consists the values and properties of the controls .

Whenever the ASP.NET page is executed, this _VIEWSTATE is filled with the page state. When the page is posted back to the server, ASP.NET recreates the values and properties of all the controls.