473,378 Members | 1,393 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

how does ASP.NET work

Hi,
1)
So I have a Textbox server side control. I edit the value in the
control client side, in my browser, and postback by clicking a button.

Now on the server-side, the request is handled, and then a response is
sent back to the browser. Let's say server does nothing, so the page is
just loaded again.

At what point in this process is the viewstate updated with the value
that I set?

2) If I change the value on a attribute of the textbox client-side and
then postback, should I expect to see the value of that attribute
maintained when the page is reloaded? How does ASP.NET manage this if
so?

Thanks!

SecretSquirrel

Nov 19 '05 #1
1 1441
Secret:
You might find some answers by looking at (indirectly):
http://openmymind.net/FAQ.aspx?documentId=1

Basically, values are maintained via two separate collections. Request.Form
and ViewState. When items are added to a dropdownlist in codebehind, they
are also added to the viewstate. When a button is clicked, the items are
recreated from teh viewstate. Then ASP.Net looks at REquest.Form for the
dropdownlist and knowns which item was selected and selects it. Values
changed on the client, such as attributes, aren't passed in Request.Form
(this is an HTML thing) and aren't added to the viewstate (nothing
client-side is ever added to the viewstate)...so that change is lost.
Viewstate only persists things added to it on the server (during the
SaveViewState method, which happens before Render and after prerender).

you might also learn more from:
http://msdn.microsoft.com/library/de...nLifecycle.asp

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"Secret Squirrel" <jb******@yahoo.com> wrote in message
news:11*********************@o13g2000cwo.googlegro ups.com...
Hi,
1)
So I have a Textbox server side control. I edit the value in the
control client side, in my browser, and postback by clicking a button.

Now on the server-side, the request is handled, and then a response is
sent back to the browser. Let's say server does nothing, so the page is
just loaded again.

At what point in this process is the viewstate updated with the value
that I set?

2) If I change the value on a attribute of the textbox client-side and
then postback, should I expect to see the value of that attribute
maintained when the page is reloaded? How does ASP.NET manage this if
so?

Thanks!

SecretSquirrel

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Jonas | last post by:
This works fine in Win XP but does not work at all in Win 98. Private WithEvents objIExplorer As InternetExplorer I have to do it like this to get it to work in Win 98 Dim objIExplorer As...
3
by: Julian | last post by:
Hi I am trying to update a date field in my table but some how this simple code does not work, I know the select work because if I write the fields, it will show the data from the table but why...
5
by: me | last post by:
I have a Class Library that contains a Form and several helper classes. A thread gets created that performs processing of data behind the scenes and the Form never gets displayed (it is for debug...
22
by: Robert Bralic | last post by:
CAN anybody tell me any address where I can download some small(1000-2000) lines C++ proghram source. Or send me ,a small(1000-2000) lines C++ program source that I can compille with gpp under...
12
by: Frank Hauptlorenz | last post by:
Hello Out there! I have a DB2 V7.2 Database (Fix11) on Win 2000 Professional. It was before a NT 4 based Domain - now it is a Win 2000 Domain. The database server is a domain member. Now...
0
by: Jarod_24 | last post by:
How does tabindex work in ASP .net pages I dosen't seem to work quite like in regular forms. and there isn't any TabStop property either. 1 .How do you prevent a control form beign "tabbed"....
14
by: Anoop | last post by:
Hi, I am new to this newsgroup and need help in the following questions. 1. I am workin' on a GUI application. Does C# provides Layout Managers the way Java does to design GUI? I know that it...
89
by: Cuthbert | last post by:
After compiling the source code with gcc v.4.1.1, I got a warning message: "/tmp/ccixzSIL.o: In function 'main';ex.c: (.text+0x9a): warning: the 'gets' function is dangerous and should not be...
14
by: webEater | last post by:
I have a problem, it's not browser specific, and I don't get a solution. I have an (X)HTML document, I show you a part of it: .... <!--<div class="pad">--> <div id="eventImages"><img src=""...
1
by: =?ISO-8859-1?Q?Lasse_V=E5gs=E6ther_Karlsen?= | last post by:
I get the above error in some of the ASP.NET web applications on a server, and I need some help figuring out how to deal with it. This is a rather long post, and I hope I have enough details that...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.