 |
| 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
|
|
|
|

November 29th, 2005, 02:42 AM
|
|
Authorized User
|
|
Join Date: May 2005
Posts: 92
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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. :)
|
|

November 29th, 2005, 11:43 AM
|
|
Friend of Wrox
|
|
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
|
|
Why don't you just use a HyperLink object?
|
|

November 30th, 2005, 01:44 AM
|
|
Authorized User
|
|
Join Date: May 2005
Posts: 92
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
But what if i use LinkButton..?
|
|

November 30th, 2005, 02:02 AM
|
|
Authorized User
|
|
Join Date: May 2005
Posts: 92
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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. :)
|
|

November 30th, 2005, 02:06 AM
|
|
Friend of Wrox
|
|
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
|
|
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
|
|

November 30th, 2005, 02:08 AM
|
|
Friend of Wrox
|
|
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
|
|
Are you using querysting values in the URL? what exactly do you want to pass to the next page?
|
|

November 30th, 2005, 02:25 AM
|
|
Authorized User
|
|
Join Date: May 2005
Posts: 92
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|
|

November 30th, 2005, 10:58 AM
|
|
Friend of Wrox
|
|
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
|
|
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.
|
|

December 1st, 2005, 01:24 AM
|
|
Authorized User
|
|
Join Date: May 2005
Posts: 92
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|
|

December 1st, 2005, 01:36 AM
|
|
Friend of Wrox
|
|
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
|
|
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:)
|
|
 |