Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Open record on an edit form from GridView

Posted on 2010-11-09
5
Medium Priority
?
336 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 2000 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

721 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