Open record on an edit form from GridView

I have a webpage that has a GridView on it with a sql link as the source.  I have a link for each record in the grid called select.  I have a textbox on the page that gets populated with the pk(id_number) on selectedindexchange event through vb.  that part is working fine, however..

I would now like to open another page to the correct pk(id_number) that I have already built for editing records.
It too has a sql link as its datasource.  The edit records are built on a ListView.

How can this be done??

I am thinking that I need to send over textbox1.text from page1.aspx to page2.aspx and use it in a param to get the correct record on the page2.aspx datasource.  But am so new to, just not sure how this can be done...
Who is Participating?
Before you open page, store the variable in session such as Session["clipboard"] = textbox1.text;
Then on page2 you can acess it by going to
string a = Session["clipboard"].ToString();
H-SCAuthor Commented:

would the script on page2 look like this..

 TextBox1.text  = Session["clipboard"].ToString();

for some reason intellisence does not like session["
If you for the TextBox1 on page 2 to contain that data then yes.
Session[" should work. Do you have using System; and using System.Web; on top of the file;
as you are using VB try Session("clipboard")
(VB uses () instead of [])

If that works, throw the points to Epitel as he beat me to the session solution :)
H-SCAuthor Commented:

Many thanks for your suggestion as well.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.