Solved

Open record on an edit form from GridView

Posted on 2010-11-09
5
333 Views
Last Modified: 2012-06-21
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 asp.net, just not sure how this can be done...
0
Comment
Question by:H-SC
  • 2
  • 2
5 Comments
 
LVL 3

Accepted Solution

by:
Epitel0920 earned 500 total points
ID: 34097168
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();
0
 
LVL 1

Author Comment

by:H-SC
ID: 34097510
Epitel0920,

would the script on page2 look like this..

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

for some reason intellisence does not like session["
0
 
LVL 3

Expert Comment

by:Epitel0920
ID: 34097578
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;
0
 
LVL 7

Expert Comment

by:mr_nadger
ID: 34100894
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 :)
0
 
LVL 1

Author Comment

by:H-SC
ID: 34123462
mr_nadger,

Many thanks for your suggestion as well.
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question