I'm using asp.internet and I am using a gridview. I've among the fields during my GridView setup like a HyperLinkField that signifies the title from the category. I pull the title and Id from the database and that i can't ever make sure what they're since they're added individually. I wish to have the ability to pass a altering CategoryId to a different page with the query string. How do i do that having a GridView?

Inside your Hyperlink area, set the DataNavigateUrlFields for your ID column and hang the DataNavigateUrlFormatString towards the Hyperlink to navigate to (where is going to be changed by ID)


It can be done using a <asp:TemplateField /> among your posts rather than a <asp:BoundField />

Code example:

<asp:TemplateField HeaderText="Name">
       <a href="/new_page?categoryId=<%#Container.DataItem("id")"><%#Container.DataItem("name")</a>

There can be a cleaner method of carrying this out instead of while using anchor element, but you need to get the concept.