Hello!
Long time no posted new post to the blog regarding the hard work on Tigers project at work, but while programming and programming, I encoutered with new asp.net 2.0 Page property that called Previous Page.This property holds all the web controls with its data and infromation of the previous page of the current page that you are in.
I found this property very useful and it can do you 'Easy Life' while getting data from the previous page that you came from (or the user that uses your application).
For example: suppose you want to use specific information from the page that you are just have been redirected from, like search term text. In the 'old fasioned' way, you needed to save this data in the Session variable or to send it by the query string of the url address and it will be expose to everyone, but PreviousPage property comes to avoid this ways by saving all the previous page data by looking for the specific control that holds the data, For example:
if (Page.PreviousPage != null){ if (Page.PreviousPage.FindControl("txtSearchTerm") != null) { string term = ((TextBox)Page.PreviousPage.FindControl("txtSearchTerm")).Text; //do your thing with this data... }}
Here I checked if there is a previous page and if it contains the txtSearchTerm Textbox controls, grab its data and use it.
Is it nice or not?