where is the value saved of the form controls(such as textbox) in post backs?

hello!

I have some puzzle in view state.I have just read an article in Msdn about view state.http://msdn2.microsoft.com/en-us/library/ms972976.aspx,It says, there are many stages in the life cycle of the page,and the Stage 2 is Load View State,the Stage 3  is Load Postback Data.In Stage 2 ,it says : During this stage, the view state data that had been saved from the previous page visit is loaded and recursively populated into the control hierarchy of the Page. And the Stage 3 is Load Postback data of the form controls,

My first question is: what is the difference of the view state data(Stag 2)and the value of the control(Postback data in Stag 3).

And the article of Msdn also says :It is a common misconception among developers that view state is somehow responsible for having TextBoxes, CheckBoxes, DropDownLists, and other Web controls remember their values across postback. This is not the case, as the values are identified via posted back form field values, and assigned in the LoadPostData() method for those controls that implement IPostBackDataHandler.

My second question is :now that the view state is not responsible for the values of the form controls,where is the value save?

thank you.

-1
gorilorzhang
5/18/2007 5:31:51 AM
asp.net.state-management 8807 articles. 0 followers. Follow

2 Replies
486 Views

Similar Articles

[PageSpeed] 17

The values from form inputs such as textboxes etc are captured in the Request.Form collection, or Request.Querystring if you are using GET as opposed to POST. In classic ASP, PHP etc, you have to manually retrieve values from the inputs on postback (form submission) and re-populate the values in the form elements.  This was hugely time consuming.  .Net removes this requirement. 


Regards Mike
[MVP - ASP/ASP.NET]
My site
1
Mikesdotnetting
5/18/2007 7:40:20 AM

your answer resolved my puzzle ,thank you !!

1
gorilorzhang
5/18/2007 8:36:49 AM
Reply:

Similar Artilces:

How to maintain form controls value after user control post back?
 hello experts, I have created filter grid in asp.net & C#.My form design has contains 3 dropdown controls and Filter grid(User control).Its working fine(filter), but one problem arise.the form controls are clear when i filter a grid(post back).I tried to reterive values using view state, hidden controls, i got only null values.Anyone please help, its urgent to me. Its my user control code.FilterGrid.aspx<%@ Control Language="C#" AutoEventWireup="true" CodeFile="FilterGrid.ascx.cs" Inherits="FilterGrid" %><style type = "text/css&...

error while post back the page if any input control(textBox) has value &#
Im working in Asp.net 2.0 and Ajax 1.0 Im getting error while post back the page if any input control(textBox) has value &# im not getting error even it has value #&  Please help.... Hi ajith P T The “&#” is a special word in HTML, it might be forbid during the postback because of the security issue.If you need this in your TextBox, you can set the ValidateRequest="false" on your <%@ Page %> tag to avoid the error. Just like the following demo:  <%@ Page Language="C#" ValidateRequest="false" %> <!DOCTY...

what data is stored of DropDownList control form view state when post back?
hello! As we know , the view state is not responsible for having TextBoxes, CheckBoxes, DropDownLists, and other Web controls remember their values across postback. When I dynamically add a DropDownList in the web,and dynamically add the items in it. such as: void Page_Load(Object sender, EventArgs e){   DropDownList ddlDynamic = new DropDownList();   ddlDynamic.ID = "ddlDynamic";    form1.Controls.Add(ddlDynamic);    if (!IsPostBack)   { for (int i=1; i <=3; i++)  ddlDynamic.Items.Add(new ListItem(i.ToStrin...

FORM values on post back
 okay... another dumb nubie question here... I am building a form with three dropdown controls to drill down through category, sub-category and product. I have each set to post back so that when the user selects the main category the sub-category  should be populated  based on the value of  the main control. The controls (or at least the first one) are binding to a WebService class. But or some crazy reason I can't seem to access the value of the main category to supply it to the sub category WebService. However the selected value of the main category is mai...

when loading a previously created record on to form, some controls are missing values(controls are depended on values selected in other controls)
Hello - I have created a page for Editing records.  this page will open up a chosen record and allow user to edit the data.On the form, I have 3 drop down lists.   The second dropdown list should fill values depending on value chosen in first dropdown list.  The third dropdown list should show/fill values depending on value chosen in second dropdown list.So taking this into count, i have several records with various data.  When I open-up/load a record in Edit form, only the first dropdown list has a value selected that was the pre-existing va...

superreview granted: [Bug 293834] Save Page As should save form inputs' state : [Attachment 278185] Goes back to SetAttribute instead of SetDefaultValue
Jonas Sicking (:sicking) <jonas@sicking.cc> has granted Ben Karel [eschew] <eschew@gmail.com>'s request for superreview: Bug 293834: Save Page As should save form inputs' state https://bugzilla.mozilla.org/show_bug.cgi?id=293834 Attachment 278185: Goes back to SetAttribute instead of SetDefaultValue https://bugzilla.mozilla.org/attachment.cgi?id=278185&action=edit ------- Additional Comments from Jonas Sicking (:sicking) <jonas@sicking.cc> Looks great, sorry for the extremely slow review on this one :( ...

Dynamic control post back value
*** edited by: master4eva *** Please enclose your code in < code ></ code> tags (without the spaces). This will make your code easier to read online; therefore, encouraging a response to be faster. It is to your own benefit for your question to be answered in future. I have already done the editing to include the < code ></ code> tags for this post. ********* I'm builidng a dynamic page with server controls inside a table based on data from sql table. While myReader.Read() Dim lbl2 As Label = New Label lbl2.ID = "l...

State management form post problem
Hi everyone! This is my first post at asp.net. I'm developing a web application using MVC and I have a doubt. There's a page named "My Account" where the user can edit his data (change his phone, address etc). So, this page gets all the user data from the database and fills all TextBox, DropDownList etc dynamically. To do this (gets data from DB), I use: 1    [Accept(Http.verbs.Get)]2    public ActionResult UserDetail3    (...)4    ViewData["nome"] = u.nome;5    ViewData["sexo&q...

how to save the View state and post back of ...
How to save the View state and post back of control added to TableCell.I adding the  control to the TableCell and lose the data, the checked not checked and other things.any one know how to handle the TableCell to not lose the controls in it (property)?Ido Yahalomi,.NET Architect www.reptor.com. What exactly are you trying to do. Can you be more explicable?Shravan Addaypally MCP...

Prevent browser refreshes from posting back an already-posted-back form?
HiI have a formview in insert mode for inserting items into a gridview.  Each item is some description text, a price, and a quantity.  I'm using SqlDataSource controls while I learn about the New Way of Doing Things.If I insert an item, and then refresh the now-posted-back page in my browser, the same item gets inserted again.  I would like to prevent this, ideally without response.redirecting on FormView.ItemInserted every time a new item is inserted.  I don't think it'd be a question of clearing the inputs and validating for data, would it?  I mean, an F5 will repo...

Menu control : Cross page posting and posted values in nested controls?
I've created a dyrnamic template for a menu control which renders either a textbox or a linkbutton. The textbox acts as an search input field. The value of this field then acts as input to another page(on another frame actually). What happens is that clicking on the linkbutton will do a postback to Main.aspx(which resides in a frame called 'MainWindow'). When the value arrives at Main.aspx, I see the value from 'searchMovies' textbox posted into the Request.form collection as : 'NavigationMenu$ctl05$searchMovies' with the value that was keyed in. From main.aspx, does anyone know...

Page not a post back choosing Controls Value
How can use java script for choosing controls value page not a refresh and Post Back Thanks   I'm not sure I understand what you are trying to do exactly? Are you just trying to get the value of a control from javascript? If so this is typically done like this:   var ctlValue = document.getElementById('myId').value;In this case the string myId is the id of the control you want to get the value for. So if I have a textbox in my html like this:   <input type="text" id="myTextBox" />I could get its value by doing:   va...

Post back clears out the value in Input Control
 Dear All, I am using html input control to upload images to database (with browse button). it is running at server. when I click on button to send data to Database, it clears out the file path or browsed file due to postback.any idea to read the file path before it clears out with click of send button.Thanks,  Can you post the code? Do you have EnableViewState="false"?CheersAlMy BlogMapStats.NETPlease click on 'Mark as Answer' if this post answered your question!  Are you talking about EnableViewState for Input control, if yes, then before it had no...

How to get value from dynamic control on Post-back
Hi All, This is my first post. The problem is about dynamic control. 1. In Page Load, I auto generated a datagrid.  Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load         Dim lmws As New LIMSWSV10.LIMSService         Dim ds As New DataSet         If Not IsPostBack Then             ds = lmws.GetResultValueForShippingJob(Request.QueryString("ShippingJobID")) ...

Form Not Post Back due to Validation Controls
I have two textboxes and two requiredFieldValidators Controls with them when i submit form with text in two fields every thing work fine. and when i miss one textbox requiredfieldsvalidator error message appears as expected. but when i enter the text in both fields now my form is not posting back to server. i don't know why Help me urgently with a good solution thanks in advance.... Hi, do you happen to have SmartNavigation enabled? Also tell us your Framework version.Thanks,Teemu KeiskiFinland, EU Hai friends, Post your code so that i sould be easier to h...

DropDownList value not post back in ajax form
I encountered a bug with ajax form with DropDownList.The selected value in DropDownList can't be posted to web server.This bug only appears in IE (mine is 7.0.5730.11), but not in FF / chrome.  Here is the sample code // *************** CONTROLLER  ***************         public ActionResult Test(int? page)        {            return View();        } // *************** CONTROLLER  *...

Preserve View State value at post back
Hi All,    I am creating a custom server control.That control contains a check box list. For the first time I am getting value for that check box list, at run time through Get/Set property. In Property I am using View state for setting value. While page is post back, the view state is getting null. How can I preserve the value of view state. Sample code is as follows,  private CheckBoxList _chkList;protected override void CreateChildControls() {string strItems; string[] StrArrItem = null;char cSplitChar = ','; int intLegth = 0;_chkList = new CheckBoxList(...

problems with web control textbox posting back
hi,  i have a simple form with a couple of vb/asp.net web server side textbox controls. They are set to not auto postback  when the text changes ( but they do seem to auto postback when a return key is entered which is fine for me ).   If i hit the return key when focused in these text boxes they cause a postback event but I cannot capture it  server side. I get redirected back to my default web page . If i use an ordinary HTML input box - the same thing  happens.  If I use an ordinary submit html button control everything works fine.  My question...

User Control : Clearing the TextBoxes on each post back
I am using a User control here and my problem is I have to ways to load it. For Add or For Update. Problem is when User clicks to Update and then changes mind and clicks the Add New button to reload the Control in Add mode, the Update Information ( Information the control was populated with prior to the reload) is still visible..Net Web/Software Engineer  If you can post your code I can take a shot at it.Gabriel Bogéa (http://www.gbogea.com)-----------------Please 'Mark as Answer' the post(s) that helped you          'CLEAN UP ...

Getting control value inside the grid at the post back
Hi,       I used the DropdownList control inside the gridview and i want to retrive the value of dropdown in gridview at the page postback. Is it possible to get the value using "Request.Form"? or is any other method to reteive the value?. Looking for help   Thanks  Dropdownlist ddl = (Dropdownlist)gridview1.rows[gridviewrowno].FindControl("dropdownlistid");string selvalue  = ddl.SelectedValue; in above you have to change  gridviewrowno to the rowno you wants to retrieve.dropdownlistid to the id of the dropdownlist in...

How to read values from dynamicly created controls when posted back?????
It seemed a good idea, making an “inquiry-tool”; users can put their questions + the way to answer (eg radiobuttons or textfields) into a database. Answers are written back into the same database. Using a placeholder I managed to get dynamicly user-written questions + ways-to-answer to the client-side. But here is the problem: How to read values from dynamicly created controls when posted back????? I really tryed very hard but I can’t. ........ Can anyone help me please?? Here’s my code: <%@ Page Language="VB" Debug="true" %> <%@ imp...

How to get table control values on post back event?
Hi, I am using table control in asp.net, there are 3 columns in the table, values of first two columns are added manually at design time and third column has text box where user needs to add values. On button click event i need to save table (cell) values of column2,column3, but some how on post back event values are disappearing in the table. There is no limit on rows, it can be one or 20 depends on user selection. Is there any way to save table values on post back event or can i disable post back event for button so that table values will not be disappeared? Thanks ...

trying to get the value of a textbox.text before a post back
ASP.NET 2.0. VB.Net  I am trying to get the value of this textbox before postback<asp:TextBox ID="Notes" runat="server" TextMode="MultiLine" Rows="6" Columns="90"></asp:TextBox>Once I get the value I would like to update a DataSet before postback 'Update Email Message Dim UpdateEmail3MessageAdapter As New Email_Temp3TableAdapters.Email_Temp3TableAdapter Dim UpdateEmail3Message As Email_Temp3.Email_Temp3DataTable = UpdateEmail3MessageAdapter.GetDataEmail_Temp3 For Each UpdateEmail3MessageRow A...

Save data between multiple post backs in user control
I have a user control ascx ie load data. The first client side action fires as post back that determines a 1 or 0 result. ie enter correct password  The next action fired from client side via postback can only act if the first action is resulting in 1. Like save data.  BUT when the second postback fires it wipes the data from the first postback , and resets to defualt ie 0. How can I store the result from the first post back in a variable for the second post back, ( i tried a basic vb.net variable but that failed) ? Any ideas... should I use a variable in the cache while the p...

Web resources about - where is the value saved of the form controls(such as textbox) in post backs? - asp.net.state-management

Control - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

Fracas in Darra after party gets out of control
Police have charged 13 people after a party in Darra descends into fights.

Gun control lobby raises alarm over silencers
... easier to get a silencer after the NSW government agreed to expand the reasons for which shooters can apply for a licence, a move gun control ...

Magnetic mind control works in live animals, makes mice happy
(credit: Windell Oskay ) For a bunch of mind-controlled mice, walking into a magnetic field has never felt sooo good. The imperceptible force ...

Creative Control Movie Review
Creative Control, written, directed and starred in by Benjamin Dickinson, depicts the scattered fragments of an ad executive’s attempt to pivot ...

Pacers take control early, surprise Spurs with 99-91 victory
INDIANAPOLIS (AP) — Three-time All-Star Paul George took it upon himself to chart the Pacers' course Monday night.

Meet The Radical Gun Control Group That Pushes The Anti-Gun Hollywood Agenda
They are a propaganda machine dedicated to smearing gun owners via entertainment venues

ICYMI: Fast brain upload, mind-control monkeys & more
Today on In Case You Missed It: Researchers at HRL Labs have developed a system to upload information to your brain using electrical signals ...

EXCLUSIVE: Ashley Greene and Cole Hauser Lose Control in 'Rogue' Season 4 Trailer
Ashley Greene joins Derek Luke and Cole Hauser in the dramatic fourth season returning to DIRECTV on March 23.

How Your Organization Can Balance Employee Freedom With Organizational Control
... employee experiences one of the biggest questions and challenges that comes up is how to balance employee freedom with organizational control. ...

Resources last updated: 3/9/2016 9:24:20 AM