Monday, August 16, 2010

How do I send value to the next page in ASP.net?

I am using a Gridview on the first page.


Inside the Gridview, there is a column with hyperlinks.


I want that when I select the hyperlink, the next page knows I have make the selection and load only the selection I made.


How do I go about doing that in ASP?


I have heard about sending value and using session?





Any clue on what to do and any websites that can prove to be useful on these?How do I send value to the next page in ASP.net?
There are several ways to share data between pages.





One of them is Session Variables. Another way is sending the parameter through GET (in a queryString).





%26lt;a href=';MyPage.aspx?id=1';%26gt;Click Here to go to my page %26lt;/a%26gt;





in the MyPage load you can read the value of the id like this:





int id;


if(Request.QueryString[';id';] != null){


id = int.Parse (Request.QueryString [';id';] ) ;


}How do I send value to the next page in ASP.net?
in hyperlink when u set url i mean to say navigate url or postback url. at that time also add the query string


like


Postbackurl=';../text.aspx?SelectionID=鈥?Id]';


you can set this [your id] with Datbinder.eval,





else you can create whole thing in itemdatabound event.





Ketan Raval


http://ketanravalitleadership.blogspot.com/


http://ketanravalnurture.blogspot.com/


http://ketanbiodata.blogspot.com/

No comments:

Post a Comment