65.5k views
5 votes
Your ASP.NET page contains a page-level variable of Customer type. You want to preserve the value of this variable across page postbacks, but you do not need this variable in any other page in the application. Which of the following state-management techniques is the best way to achieve this?

a. Query strings
b. Cookies
c. ViewState
d. Session

User Guimo
by
4.6k points

1 Answer

4 votes

Answer:

Option c is the correct answer for the above question.

Step-by-step explanation:

View states are a mechanism that is used in c# programming language, It is used on only one page on which the user or programmer is working currently. It does not hold the records when the control goes to the other page.

The above question also wants which is described above. Hence option c is the correct answer while the other is not because:-

  • Option a states about the query string which is not any technique to hold the record.
  • Option b states about cookies which are used to hold the record of all page.
  • Option d states about the session which is used to hold any record and can be accessed on any page.
User Pubudu Jayawardana
by
4.2k points