Wrox Programmer Forums
|
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 9th, 2006, 06:59 AM
Registered User
 
Join Date: Jan 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to tbekarov
Default passing variable

Hi there I'm Tome form Macedonia.I'm developing ASP.NET 2.0 app.
    There is page with datagrid and when I click select button it opens popup window whit TextBoxes, I want to fill this TextBoxes with data from the clicked row. The question again: How can I pass a variable holding an index or something of clicked row so i can fill (from dataset) the textboxes in popup window.pls help me thanx in advance.

 
Old January 26th, 2006, 11:47 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

In the selectedindexchanged event of the gridview, you can grab the value if the ID you want to pass to the pop up window.

Jim

 
Old February 1st, 2006, 02:59 AM
Registered User
 
Join Date: Jan 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to hawkfb63
Default

This sounds very close to something I want to do. Jim, would you mind going into more detail on how to do this. I am somewhat new to asp, and just started using 2.0 a very short time ago. I have a gridview that binds data and only returns one cell. I want to pass the data from that one cell to a string to be used by another parameterized SQL query. Is this possible? Any help you can give would be great.

 
Old February 1st, 2006, 02:21 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

question: why show a grid with only one value? If that is the only value returned and you want to use that data for a qurey, just grab that value and pass it along.

 
Old February 1st, 2006, 02:56 PM
Registered User
 
Join Date: Jan 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to hawkfb63
Default

I would like the value to be displayed so that it is easy for people entering data to cross-check. And the gridview is an easy way to display the data...And I dont know how to pass it along so that it may be used to enter data into another table.

 
Old February 1st, 2006, 03:36 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

<somevar> = GridView1.Rows(0).Cells(0).Text

 
Old February 1st, 2006, 03:59 PM
Registered User
 
Join Date: Jan 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to hawkfb63
Default

Thank You Thank You!!!

 
Old February 1st, 2006, 04:16 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

glad to help...
Jim






Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing a Variable LarryS Beginning PHP 1 August 8th, 2006 07:52 AM
Passing variable to a public variable Hudson40 Access VBA 2 February 25th, 2005 06:23 AM
Passing a variable mrideout BOOK: Beginning ASP.NET 1.0 3 August 6th, 2004 02:57 PM
Passing a variable trekmp ADO.NET 1 March 4th, 2004 01:57 PM
passing variable gumgak Classic ASP Databases 13 June 29th, 2003 09:13 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.