Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 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 November 29th, 2005, 02:42 AM
Authorized User
 
Join Date: May 2005
Posts: 92
Thanks: 0
Thanked 0 Times in 0 Posts
Default Selecting a particular item in Datagrid

Hello Friends,
I created a datagrid which has several linkbuttons on it.(on row as well as column).

Now, i want that when i click on any of the linkbutton on the page, then control shud go to the corresponding page.

I have tried to code on ItemCommand event of datagrid, and
e.Item.Itemindex gives the index of the particular row.
I am also able to find the total no. of columns, rows and items.
But to which method/property of linkbutton shud i code to pass d control to next page.

Pls let me know asap..

Thanks n Regards,
Muskaan. :)

 
Old November 29th, 2005, 11:43 AM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

Why don't you just use a HyperLink object?


 
Old November 30th, 2005, 01:44 AM
Authorized User
 
Join Date: May 2005
Posts: 92
Thanks: 0
Thanked 0 Times in 0 Posts
Default

But what if i use LinkButton..?

 
Old November 30th, 2005, 02:02 AM
Authorized User
 
Join Date: May 2005
Posts: 92
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hey,
I am using 5 Hyperlink controls for each of the 5 columns.
But how shud i retrieve the values from my first page if i want to transfer to next page.
Its like when I click on a hyperlink then it will pass the control to the page specified in "NavigateUrl" tag, but how can i retrieve the values from my first page to the next.
And all this is being done in datagrid.....

Regards,
Muskaan. :)

 
Old November 30th, 2005, 02:06 AM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

You can try to use the datagrid's ItemCommand event and use:
e.CommandName to gett he command name and do something based on your criteria

 
Old November 30th, 2005, 02:08 AM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

Are you using querysting values in the URL? what exactly do you want to pass to the next page?

 
Old November 30th, 2005, 02:25 AM
Authorized User
 
Join Date: May 2005
Posts: 92
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I was using query string for linkbutton.
And i want to retrieve the values of comboboxes of first page to the next page after the hyperlink is clicked.


 
Old November 30th, 2005, 10:58 AM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

You have to either use sesson variables to store the values before you redirect, or you can use Server.Transfer and then grab the values from the object. I would use session variables.

 
Old December 1st, 2005, 01:24 AM
Authorized User
 
Join Date: May 2005
Posts: 92
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Okie...
I am using hyperlink control which i have defined in HTML code design form.
There i am passing the path of the file where the control shud transfer in "NavigateUrl" tag.
But i am not able to pass the query string variables in URL.

And if u r saying to use Session variables, how do i use them as i wud be using them for the first time.
Pls guide.


 
Old December 1st, 2005, 01:36 AM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

Will the query sting variables differ for each URL? If so you can use the ItemDataBound event of the grid and contstuct the URL there and assign it to the URL.
If you want to use session variables:
session("some var:) = "some value"

Then to retrieve it on the next page
some var = session("your session var:)







Similar Threads
Thread Thread Starter Forum Replies Last Post
Selecting DropDownList Item yes_no ASP.NET 1.0 and 1.1 Professional 1 April 8th, 2008 08:00 AM
problem selecting listview item method Visual C++ 0 July 7th, 2006 04:06 PM
Selecting a ListView item bmains Pro VB.NET 2002/2003 0 January 22nd, 2005 11:19 PM
Selecting an Item from a databound listbox nyclimber ASP.NET 1.0 and 1.1 Professional 4 May 25th, 2004 03:24 PM





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