Buy Questpond's video subscriptions on
huge discount
.
Online: 542
Home
Articles
Interviews
Forums
For Beginners
Popular Questions
ITIL Career Advice
PMP Career Advice
Career Advices
Codes
Videos
ASP.NET
ASP.NET MVC
Android Intel XDK
Sql Server
AngularJS
Bootstrap
Backbone.JS
MongoDB
LESS (CSS)
jQuery
WPF
WWF
SSIS
LightSwitch
Tutorials
News
ASP.NET MVC
|
Be Interview Ready
|
Top Performers
|
DNF MVP
|
Top Posts
|
Winners
|
Subscribe
|
Catalogs
Welcome Guest !
Register
Login
Home
>
Interviews
>
ASP.NET
>
Loading ...
Is view state lost if a user refreshes a Web page? What if the user copies the URL and open it in other browser?
Posted by
Virendradugar
on 10/13/2009 | Category:
ASP.NET Interview questions
| Views: 16967
Post
|
Interview FAQs
|
Exclusive Questions
|
Interview Home
Answer:
View state is maintained within a page’s HTML, so it is lost if a page is refreshed or if the URL is copied.
Asked In:
Many Interviews |
Alert Moderator
Bookmark It
< Previous :
Which control requires the Web.sitemap file to dis ...
Next > :
What is View State Chunking?
Comments or Responses
Posted by:
Raja
on: 10/13/2009
I think the answer is wrong.
ViewState is not lost when page is refreshed. Of course when you go from 1st page to 2nd page the 1st page viewstate is lost. Even in case of copy-paste viewstate remains.
I guess your question is not clear. ViewState is nothing but the state of the control at the time of submitting the data onto the server or the state of the control when the page renders to the browser so either in case of copy-paste url or same page refresh it remains on the page (See the ViewSource of the page and you will see that).
Hope this clarifies, please write your response, if any.
Thanks
Posted by:
Virendradugar
on: 10/14/2009
Hi Raja,
Thanks for your response.
Let's say a user is accessing Page1.aspx and he update some data on the page and the data gets updated but my URL is not changed. So when I copy this URL and paste it in other browser ViewState will not be the same as for both the pages.
In case of refreshing the page, Suppose you are accessing makemytrip.com. And you select source and destination city and click on get data. But when you refresh the page, you will notice that selected data is lost. It again contains the old values.
Let me know if It makes any sense.
Thanks,
Virendra Dugar
Posted by:
Raja
on: 10/14/2009
Above two points are completely different.
Let's say a user is accessing Page1.aspx and he update some data on the page and the data gets updated but my URL is not changed. So when I copy this URL and paste it in other browser ViewState will not be the same as for both the pages.
ViewState will be maintained for the default rendering of the form, when posted back the state of the control will be maintained (if you are not using ASP.NET AJAX UpdatePanel), even if you press F5 or Refresh the page. But of course when you are copying pasting the url, the state of the control will not be maintained with what you had selected at the time of updating the form as that copy-pasting the url will render the page as served by the user.
For 2nd point also above explanations will apply.
In case of post back, the ViewState of the page will be maintained for you even if you are refreshing the page provided you are not using partial postback or Ajax to post the page.
If you are using partial postback or ASP.NET Ajax to post the page, ViewState will be lost even for yourself, for other user or in other browser by copy-pasting the url
I think we both are on the same page but a the question is very generic to come to a conclusion.
Hope you agree.
Posted by:
Siddydv27
on: 11/15/2017 |
Points: 10
So great facebook friends the large http://fbpasshack.net peace of word friends thanks a lot.
Posted by:
Siddydv27
on: 11/15/2017 |
Points: 10
So great page the
http://fbpasshack.net
site.
Login to post response
More Interview Questions by Virendradugar
What is View State Chunking?
Which might not work if a user has disabled cookies in his or her Web ...
Which typically consumes more memory: application state or session sta ...
To perform asynchronous data access, what must be added to the connect ...
You are working with a DataSet and want to be able to display data, so ...
Can you nest UpdatePanel within each other?
What are the different code models available in ASP.NET 2.0?
Can the App_Code folder contain source code files in different program ...
Latest Interview Questions
What is a Lambda expression?
I need to Add one column in a existing table and the max value of the ...
What is the name of store procedure to send Email using SQL Server 200 ...
Query to Get List of Views?
Query to Select n Rendom Records From a Table in the Database?
Query To Get The Column Name,DataType, And Length of columns in a Tabl ...
How we can Get List of Triggers?
Query to Get List of Table Valued Functions?
More ...