.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

How to place hyperlink in GridView

Posted By: Ramesh     Posted Date: December 31, 2008    Points:2   Category :ASP.Net
How to place Hyperlink inside GridView. I need to place Querystring also in the hyperlink column inside GridView In asp.net.

Data is coming from SQL Server and that is used to bind Query String which holds id

Please help me. Any help wold be appreciated.

Author: susant             
Posted Date: December 31, 2008     Points: 5   

Hi try this

Write in this way in soruce file of gridview..
<asp:GridView ID="GridView1" runat="server">
<a href="CourseContent.aspx?fullname=<%# Eval("fname") %>"> </a>

.cs file
select the values from database

NOTE: here <%# Eval("fname") %>"> is the value "fname" from DB..
CourseContent.aspx is the .aspx file which it will take "fname" value....

Author: aamir             
Posted Date: January 01, 2009     Points: 5   

u can do as follow

<asp:GridView ID="GridView1" runat="server">
' one approach
<asp:HyperLinkField NavigateUrl='<%# Eval("url-field") %>' Text='<%# Eval("text-field") %>' />

' another approach
<a href='<%# Eval("url-field") %>'><asp:Label ID="lblLink" runat="server" Text='<%# Eval("text-field") %>'></asp:Label></a>

Author: Athira Sreejith             
Posted Date: January 02, 2009     Points: 5   


hypRemainingDate = new HyperLink();
// hypRemainingDate.CssClass = "boxtext_blue_Hyperlink";
hypRemainingDate.Text = FullRDate;
hypRemainingDate.NavigateUrl = "ExpensesStatement.aspx?mode=dashboard&&monthYear=" + monthname + "&&Date=" + GetRemainingDate[i] + "";
//gvr.Cells[2].Text = ExpenseDate;

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