Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Professional
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 29th, 2005, 02:42 AM
Authorized User
 
Join Date: May 2005
Location: pune, maharashtra, India.
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. :)

  #2 (permalink)  
Old November 29th, 2005, 11:43 AM
Friend of Wrox
Points: 4,332, Level: 27
Points: 4,332, Level: 27 Points: 4,332, Level: 27 Points: 4,332, Level: 27
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2003
Location: , NJ, USA.
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

Why don't you just use a HyperLink object?


  #3 (permalink)  
Old November 30th, 2005, 01:44 AM
Authorized User
 
Join Date: May 2005
Location: pune, maharashtra, India.
Posts: 92
Thanks: 0
Thanked 0 Times in 0 Posts
Default

But what if i use LinkButton..?

  #4 (permalink)  
Old November 30th, 2005, 02:02 AM
Authorized User
 
Join Date: May 2005
Location: pune, maharashtra, India.
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. :)

  #5 (permalink)  
Old November 30th, 2005, 02:06 AM
Friend of Wrox
Points: 4,332, Level: 27
Points: 4,332, Level: 27 Points: 4,332, Level: 27 Points: 4,332, Level: 27
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2003
Location: , NJ, USA.
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

  #6 (permalink)  
Old November 30th, 2005, 02:08 AM
Friend of Wrox
Points: 4,332, Level: 27
Points: 4,332, Level: 27 Points: 4,332, Level: 27 Points: 4,332, Level: 27
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2003
Location: , NJ, USA.
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?

  #7 (permalink)  
Old November 30th, 2005, 02:25 AM
Authorized User
 
Join Date: May 2005
Location: pune, maharashtra, India.
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.


  #8 (permalink)  
Old November 30th, 2005, 10:58 AM
Friend of Wrox
Points: 4,332, Level: 27
Points: 4,332, Level: 27 Points: 4,332, Level: 27 Points: 4,332, Level: 27
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2003
Location: , NJ, USA.
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.

  #9 (permalink)  
Old December 1st, 2005, 01:24 AM
Authorized User
 
Join Date: May 2005
Location: pune, maharashtra, India.
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.


  #10 (permalink)  
Old December 1st, 2005, 01:36 AM
Friend of Wrox
Points: 4,332, Level: 27
Points: 4,332, Level: 27 Points: 4,332, Level: 27 Points: 4,332, Level: 27
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2003
Location: , NJ, USA.
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:)


 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 10:15 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.