Gridview

M

MC

Hi all,

Quick question for you.

I need to include a parameter into this asp:HyperLinkField of SchoolID. I
tried adding Request.QueryString("SchoolID") but it didnt work.

<asp:HyperLinkField DataNavigateUrlFields="ActionID"
DataNavigateUrlFormatString="AddSchool5.aspx?ActionID={0}"
DataTextField="Action" />

Anyone know the answer?

Cheers

Just realised I sent it too wrong group
 
J

Joshua Mitts

Try the following (note the change to single quotes in
DataNavigateUrlFormatString:

<asp:HyperLinkField DataNavigateUrlFields="ActionID"
DataNavigateUrlFormatString='<%#
String.Format("AddSchool5.aspx?ActionID={0}",
Request.QueryString("SchoolId")) %>'
DataTextField="Action" />

Then in your code somewhere, you need to call DataBind() on this
HyperLinkField or a control containing this HyperLinkField. For more
information on data binding, check out this link:

Data Binding Expression Syntax
http://msdn.microsoft.com/library/d...ref/html/cpconDatabindingExpressionSyntax.asp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,709
Latest member
AustinMudi

Latest Threads

Top