In this post we will discuss how we can add Eval property into hyperlink field in gridview in Asp.Net.
In this schnerio, we will see how a user can navigate to a different page with a query string parameter. In the below code it will see a list of usernames which are binding from the database. Then whenever a user clicks on a particular username, then it will navigate to a UserDetails page with taking UserID as a querystring parameter.
<asp:HyperLink ID=”hylMachineNum” runat=”server” NavigateUrl='<%# “~/UserDetails.aspx?UserID=” + Eval(“UserID”)%>’ Text='<%#Eval(“UserName”)%>’>
Here the Text value is coming from the Eval property by the following syntax.
And the NavigateURL property is coming from the below property:
NavigateUrl='<%# “~/UserDetails.aspx?UserID=” + Eval(“UserID”)%>’
Also, you can check out some posts on:
Download FREE SharePoint 2019 Installation PDF Guide
This FREE PDF contains, Steps by step guide to install SharePoint 2019 Preview, prerequisites, hardware and software new features. First impression to SharePoint Server 2019 new modern site, modern lists and modern document libraries.
You May Also like the Following SharePoint Online Tutorials: