Pass multiple parameters from gridview hyperlink control

<asp:HyperLinkField DataTextField="CategoryName" DataNavigateUrlFields="CategoryID" DataNavigateUrlFormatString="NewPage.aspx?id={0}"
HeaderText="HyperLink Column" />

How can I amend the above code so the link ALSO passes propertyID as a parameter as well

Who is Participating?
sasapopovicConnect With a Mentor Commented:
Hello mugsey,

In DataNavigateUrlFields put all columns/properties separated by comma and use more placeholders in DataNavigateUrlFormatString. For example (from

<asp:SqlDataSource id="datasource1" runat="server"
     SelectCommand="SELECT CustomerID, CompanyName, City FROM Customers"
<asp:GridView id="gridview1" DataSourceID="datasource1" runat="server"
    <asp:BoundField DataField="CustomerID" HeaderText="BoundField" />
    <asp:HyperLinkField runat="server" 
           "{0}&city={1}" />

Open in new window

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.