DotNet Blogs

Articles of ASP.NET, C# & SQL Server

pass multiple query string using HyperLinkField in Gridview

Posted by Sujit Kumar on November 1, 2008

You can pass single/multiple query string using HyperLInkField

Pass data field name in DataNavigateUrlFields which you wnat to pass value in query string
ex:

DataNavigateUrlFields=”subject,query”

here subject and query both are differenct data field those are comming from database.

and write the page name in DataNavigateUrlFormatString where you want to pass query string value.

ex:

DataNavigateUrlFormatString = “~/Pages/default.aspx?UserName={0}&GameTitle={1}”

asp:HyperLinkField HeaderText=”View Details” DataNavigateUrlFields=”subject,query” DataNavigateUrlFormatString = “~/Pages/default.aspx?UserName={0}&GameTitle={1}” Text=”View”

One Response to “pass multiple query string using HyperLinkField in Gridview”

  1. Quinn said

    This was helpful, thanks! Unfortunately my other query string is not a data field, but rather from a drop down list elsewhere on the page. Not sure the best way to handle that.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>