Prev | Current Page 172 | Next

Rob Cameron and Dale Michalk

"Pro ASP.NET 3.5 Server Controls and AJAX Components"

UniqueID] != null)
HiddenLabel.Text = Request.Form[HiddenName.UniqueID];
// check the Viewstate for the viewstatename variable
ViewStateLabel.Text = "";
if (ViewState["viewstatename"] != null)
ViewStateLabel.Text = ViewState["viewstatename"].ToString();
}
}
}
Clicking the Set State button submits the page via postback to ASP.NET, which retrieves
the name gathered from the NameTextBox control on the ClientState.aspx web form and pushes
it out to the client-state mechanisms we are interested in testing.
The page that renders after the server-side execution of Set State is complete contains the
client state for the name entered into the NameTextBox control. The URL has the name embedded as
part of the query string. If you click the link, it will force a read of the query string state, which
allows the URL field at the bottom of the page a chance to show the value through this state
mechanism. The web form has two hidden variables; one is populated with ViewState and used
to hold the name entered by the user in the web form, as a developer would code using just
hidden input tags. To see this, select View ??ยค Source in the browser. Finally, the Cookie value is
included in the HTTP response.
Interestingly, the URL fields at the bottom of the page are blank.


Pages:
160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184