Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hyperlink column (in DataGrid) passing more than one parameter

Status
Not open for further replies.

StevenK

Programmer
Joined
Jan 5, 2001
Messages
1,294
Location
GB
We have a DataGrid on a web form (ASP.NET using C# code) in which we have a Hyperlink column.
We're able to pass one parameter to another page via this Hyperlink. For instance against the grid designer we're setting :
- URL Format String : WebPage2.aspx?Param1={0}
- URL Field : Field1
... And then reading the parameter in the second form using :
- string param1 = Request.Params["Param1"];
The {0} parameter in the URL Format String passes the 'Field1' entry.
How would we create a Hyperlink passing two parameters - i.e. two such entries from the grid (let's say Field1 + Field2).
We've tried various combinations with no success - any help would be appreciated.
Thanks in advance.
Steve

 
The only way that I know of is to do straight string concatenation, so:

<a href='
<%#
"WebPage2.aspx?Param1=" +
((DataRowView)Container.DataItem)["Param1"] +
"&Param2=" + ((DataRowView)Container.DataItem)["Param2"]
%>'>Click here to send the params</a>

Something along those lines.

-paul

penny.gif
penny.gif

The answer to getting answered -- faq855-2992
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top