.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month

Home >> Forum >> ASP.Net >> Post New QuestionBookmark and Share Subscribe to Forum

Gridview Hyperlink

Posted By: Aamrapali Tamgadge     Posted Date: December 25, 2010    Points:2   Category :ASP.Net
Hello,Sir Me having No of Gridviews, and in it der is a labels like below i shown. but now i want to add hyperlink to this label so that by clicking it i can show the diff. .aspx page.so ple suggest me how can i add hyperlink.

<asp:Label ID="lblBSchool" runat="server" Text='<%# Eval("BSchoolDescreption") %>'></asp:Label>

in abow code how to add hyperlink?

Author: Manas Patnaik             
Posted Date: December 25, 2010     Points: 5   

Assign desired Hyperlink value in grid View RowCreated Event.

  protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e)


Manas Patnaik
Author: Syed Shakeer Hussain             
Posted Date: December 25, 2010     Points: 5   

Try with the below code get your output..

<asp:LinkButton ID="lblBSchool" runat ="server" CommandName ="selectBSchool" 
Text ='<%#Eval("BSchoolDescreption") %>'>


protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
if (e.CommandName == "selectBSchool")
Response.Redirect("PageName.aspx") ;

Post Reply

You must Sign In To post reply
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend