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

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

link in gridview

Posted By:      Posted Date: September 04, 2010    Points: 0   Category :ASP.Net
hi all i have the following gridview1) i would like the Vistidate column to be a link2) as you can see each patient can have multiple visit dates. when for example i click on 12/08/10 which is going to be a link i would like a new page to open and bring all the details from that visit into the various textboxes that i have such as DOB, telephone etci am a newbie so please be gentle:)thanks

View Complete Post

More Related Resource Links

gridview hyperlinkfield link to point on another page

I have several gridviews on an aspx and each has a hyperlinkfield.  All of them redirect to another page with a single gridview.  I am trying to figure out how to get each hyperlinkfield to redirect to the actual point on the receiving page with the corresponding value. In the sample data below, I need to be able to click on 'def' and open aspx page 2 to the point on the page where 'def' is located.  All values still need to be visible.  Sorry for this sad sample, but I wasn't sure how else to explain.  Can anchors be used in gridviews???  If so, how?  Please advise. aspx page 1: (gridview1) hyperlinkfield1             field2                field3 abc                              f2data1             f3data1 def                               f2data2             f3data2   (gri

Gridview Link Button control click event


Respected Reader,

I have  Web page that uses LinkButton control inside Template Fields of Gridview.

I am trying to work on LinkButton Click event and trying to preserve the Value of LinkButton that user click, and based on that value, i want to refresh tha page data.

I used CommandName and CommandArgument property of Linkbutton, but i can use that property only in GridView_RowCommand method by checking e.CommandName expression. But the problem with that Gridview_RowCommand event fire after all other page_load activity. So the value never used in the page_load event to refresh the data in all other control.

I also tried to use OnClick Method, Session variable and Hidden variable. but when i run Response.Redirect method from Gridview_RowCommand, it clear all the Session and Hidden variable values. also tried (Response.Redirect(,false)) method but never got success.

Any suggestion will be appricated in advance.

GridView Hyper Link not working



<asp:TemplateField ShowHeader="false" ItemStyle-Width="50px">
                            <asp:HyperLink runat="server"  NavigateUrl='<% string.Format("~/Tiff.aspx?Id={0}, Eval("ID")) %>'  Target="_blank" Text="View" />

When I m trying to click on it...It is not working or not firing any event,

May I know the reasong or any code behing is require


make Gridview data as hyper link with alias open in new window



I have one asp.net C# page in which i have gridview..

This are the url comes from database and binded in gridview




what i need is i need to show this url has like this

www.xxxxxx.com/A/Default.aspx is like Test1

www.xxxxxx.com/B/Default.aspx is like Test2

www.zzzzz.com/C/Default.aspx is like Test3

if user click Test1 it will open a new browser window with www.xxxxxx.com/A/Default.aspx

if user click Test3 it will open a new browser window with www.zzzzz.com/C/Default.aspx 

how to make this in gridview please help me in this...

Web.Config issues - Trying to add SQLExpress database link so that I can see a GridView in a Web Pag


Current Web.Config
<?xml version="1.0"?>
      <sectionGroup name="system.web.extension

create link button dynamically in gridview


Hi All,

I am trying  to add/insert linkbutton dynamically inside gridview row, below is the code

protected void Page_Load(object sender, EventArgs e)
        DataTable dt = new DataTable();
        DataColumn dcol = new DataColumn("Measure", typeof(System.String));

        DataColumn dcol1 = new DataColumn("ID",typeof(LinkButton));
        DataRow drow = dt.NewRow(); 

            LinkButton btn = new LinkButton();
            btn.ID = "testbtn";
            btn.Text = "1";
            btn.Visible = true;


            //drow = dt.Rows[0];

            drow[0] = "testmeasure";
            drow[1] = btn;

        catch{ }


        GridView1.DataSource = dt;


Problem I facing is that the data table is getting created fine with teh linkbutton as well but the gridview is not showing the linkbutton. upon executing I am only the column which is of string type.

Please help me in this case. what I am doing wrong? please help. this is urgent.


Embed FLV video with dynamic link in gridview


Hi guys, i need your help.

Currently i'm designing a gridview which could present an flv video file which was located on the database using sql. I use jw player to present the video (http://www.longtailvideo.com/players/jw-flv-player/

Therefore, on the <itemtemplate> i use this code to embed the video:

<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' width='400' height='300' id='single3' name='single3'>
                                    <param name='movie' value='../data/flashPlayer/player.swf'>
                                    <param name='allowfullscreen' value='true'>
                                    <param name='allowscriptaccess' value='always'>
                                    <param name='wmode' value='transparent'>
                                    <param name='flashvars' value="file=<%# "../data/uploadedData/video/flv" + Eval("videoUrl") %>">

Gridview displaying text not link


I have a gridview that is bound to a table in my database.  The second column I'm grabing from the table has the HTML code to create a link.

ex. <a href="yahoo.com"> yahoo</a>

When I bind it to my grid it shows me this text instead of just the word "yahoo" that is a link.

This is my gridview

<asp:GridView ID="grd" runat="server" Visible=true  BackColor="White" BorderColor="ActiveBorder" BorderStyle="Solid" BorderWidth="0px" CellPadding="4" 
ForeColor="Black" GridLines="Vertical"                                    AutoGenerateColumns="False" allowsorting="True"                 onrowdatabound="grd_RowDataBound">
		      <asp:BoundField DataField="country" HeaderText="" />
		      <asp:BoundField DataField="name" HeaderText="" />

Thank you for any help

how to change the color of disabled link button in gridview



how to change the color of disabled link button in gridview?.. 

Retrieving data from database to link to gridview by using listbox


hello, I have a search option which a person can use a multi select listbox. I have it coded so it would loop through to see if its selected or not. I also have a stored procedure where the sql statement is coded for the select statement. For some reason, its not populating my gridview. Where am I doing wrong? Below is the code and stored procedure. Thank you, Carlos


<%@ Page Language="VB" AutoEventWireup="false" CodeFile="ExportContacts2.aspx.vb" Inherits="ExportContacts2" %>
<%@ Import Namespace="System.Web.Mail"  %>

<%@ Import Namespace="System.Data" %>

<%@ Import Namespace="System.Data.SqlClient" %>

<%@ Import Namespace="System.Configuration" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
    Protected Sub submit_Click(ByVal sender As Object, ByVal e As EventArgs)
        Dim strtxtevents1 As String
        Dim lin4 As ListItem
        Dim myArrayList4 As ArrayList = New ArrayList()
        Dim strarr4() As String
        For Each lin4 In eventsi.Items
            If lin4.Selected = True Then

how can I link to the especial page of Gridview?


Hi frieds,

in my gridview there is a link in every row to the page to edit every row. 

How can make a like in Edit page to back to the page of gridview with edited row?


Thamks in advance,


Inplace Edit in GridView

In this article I am presenting a different way to look at EditItemTemplate, using which user navigation for editing is reduced and . it looks very different (see screeen shots) then regular implementation of GridView.

GridView Confirmation Box Using JQuery BlockUI in asp.net

JQuery is the most popular JavaScript library. One of the main reasons for its fame is the plugin architecture. Anyone can create a separate library that leverage the JQuery library. In this article we are going to look at the BlockUI library which is used to block the user screen while performing a task.

Textbox Editable GridView in ASP.NET

This article describes how I made a fully editable gridview in C# using ASP.NET 2. The idea is that the GridView looks and works like an Excel spreadsheet. You see all the cells in the table, and you can edit any of the cells you like, and they are automatically updated (i.e. saved to the database). This is very often how people expect data tables to work in web pages, and I've often seen people clicking in vain on un-editable gridview cells, somehow expecting to edit them, and not understanding that they need to click an Edit button at the end of the row.

Adding Dynamic Rows in ASP.NET GridView Control with TextBoxes and with Delete functionality

In my previous examples, I have demonstrated on how to add dynamic rows in GridView control with TextBoxes and how to save the values into the database. Now, seems that most of the developers are asking if how to add a delete functionality with it. So in this example, I'm going to show on how to delete a certain row in the dynamic GridView with TextBoxes.

AJAX GridView Checkbox Select All in ASP.Net

In the previous article GridView Select Multiple Rows you learnt the multiple row selection in GridView control. Here you will get the C# code sample to select all the gridview rows using single checkbox server control. You can highlight the selected rows with different color and Font state Bold. If you want to use the selection values on different ASP.Net

AJAX GridView Paging and Sorting using C# in ASP.Net

To enable the GridView Paging and Sorting to update the GridView Data without refreshing the ASP.Net web page AJAX Extension controls are used. UpdatePanel is used to hold the GridView control that triggers the events for the controls placed inside it. By Default UpdatePanel triggers the asynchronous postbacks for its child controls.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

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