Gridview Hyperlink

Gridview Hyperlink


    Here we will bind GridView fields to HyperLink and we will link hyperlink to bing.com to do search. You can even use anchor tag instead of hyperlink.

<ItemTemplate>

<asp:HyperLink ID="HyperLink1" 
        
runat
="server"
       
 
NavigateUrl='<%# "Http://www.bing.com?q="+DataBinder.Eval(Container.DataItem,"FirstName") %>'


Text
='<%#DataBinder.Eval(Container.DataItem,"FirstName") %>'>

</asp:HyperLink>

</ItemTemplate>



In above code snippet we have, gridview dynamic hyperlink.

NavigateUrl='<%# "Http://www.bing.com?q="+DataBinder.Eval(Container.DataItem,"FirstName") %>'


The DataBinder.Eval will extract FirstName from the DataSource.

 

Tags:

Gridview Hyperlinkgridview add new rowasp.net Gridview checkboxJquery Gridview Dropdownlist Selected Change Enable Disable ControlsGridView RowGridView EditJQuery Hyperlink ClickGridView SerialCheckbox Check all GridviewJavascript visible hide hyperlinkAsp.net open new window

Author

My name is Satalaj, but people call me Sat. Here is my homepage: . I live in Pune, PN and work as a Software Engineer. I'm former MVP in ASP.net year 2010.
Disclaimer: Views or opinion expressed here are my personal research and it has nothing to do with my employer. You are free to use the code, ideas/hints in your projects. However, you should not copy and paste my original content to other web sites. Feel free to copy or extend the code.
If you want to fight with me, this website is not for you.
 

I'm Satalaj.