How to pass a variable using GridView (Asp.Net)?

Timberton4

New member
There's a GridView in my Page. I want to pass the text of a cell where i clicked on the HyperLinkField (which is in my GridView)!
I know how to do it but i think i'm doing something wrong.... the GridView has data source to a linq to sql DB... i added a HyperLinkField (from GridView task) and i enter:

NavigateUrl => my other page
DataNavigateFormatString => otherpage.aspx?id={5}
DataNavigateFormat=> (the name of my datafield)



and in the otherpage i have the vb code:

dim myVar = Request.QueryString("id")


....... But when i debug the pages, the myVar is Nothing!!!!

So PLEASE PLEASE Help me Out! It's really important for me!

Thanks A MILLION! :)


Btw: there's 5 columns in the GridView and the 5th is invisible (the column that i want the text for my variable) :D
I use vb.net but the C# code is also okay! :D Thanks again! ^-^
 
Ive bumped into same issue with c#.net. Invisible column values become null when i tried to retrieve it.

the work around there is to use the onrowdatabound event. This is where will you set the cell url value and parameter via the attributes.add method or find the hyperlink control and assign the navigateurl method. then set the visibility into false of the next column. Choose what is easier for you..
 
Back
Top