Solved

Open record on an edit form from GridView

Posted on 2010-11-09
5
329 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
mr_nadger,

Many thanks for your suggestion as well.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
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 …
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

743 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now