Solved

Open record on an edit form from GridView

Posted on 2010-11-09
5
335 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
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 …
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

623 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