0

How to use Datanavigateurlformatstring of hyperlink in gridview?

I want to display page with the name of product like

http://localhost:55724/Admin/Category/Update/computer when I clicked on computer in gridview, it says resource not found.

<asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False"> 
    <Columns> 
        <asp:BoundField DataField="id" HeaderText="Id" />
        <asp:HyperLinkField DataNavigateUrlFields="id" 
                            DataTextField="Productname" 
                            HeaderText="Product" 
                            Target="_blank" 
                            NavigateUrl="Searchdetails.aspx?product={0}" 
                            DataNavigateUrlFormatString="~/Product/Searchdetails.aspx?product={0}" /> 
    </Columns> 
</asp:GridView>

How to fix this error.

Tasos K.
  • 7,979
  • 7
  • 39
  • 63

0 Answers0