.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

Hyperlink in GridView

Posted By:      Posted Date: September 02, 2010    Points: 0   Category :ASP.Net
I have a GridView with the bounded Fields "ProductNumber" and "FilePath". The idea is to select a product from a row and to open the corresponding PDF from the file path in a new window via target=_blank, I have already searched via Google but I didn't find anything thats suitable. Something like this doens't works:<asp:TemplateField> <ItemTemplate> <asp:HyperLink ID="link" runat="server" datatextfield="ProductNumber" NavigateUrl="<%# FilePath %>">"</asp:HyperLink> </ItemTemplate> </asp:TemplateField>   I hope someone can help me. Thanks!  

View Complete Post

More Related Resource Links

How To display image in GridView as hyperlink


Hello Everyone 

Could someone please help me with a little issue....

I was able to save the image in the database as binary....... but now i don´t know how to display it in the GridView as a hyperlink.

I´ve read something about ImageField..... I´d appreciate any help .


Gridview hyperlink field

Hi I have a gridview that has two fields. Both fields are databound...but the one field is a hyperlink field which works fine...but I would like to add a Request.QueryString value to the the value retrieved from the database when setting the navigateurl property. Help would be much appreciated

Passing an ID from a hyperlink in a gridview

I have  gridview that lists a column of hyperlinked names.  A procedure is passed to get the data for the gridview.  I am also pulling an ID to use once the name is clicked.  Once clicked the ID is used in another procedure to populate a formview.  I am having a problem getting the ID to be associated to each hyperlink name in the column and figuring out how I am going to grab the ID from the asp:hyperlinkfield and then assigning it a variable to use elsewhere.  Any ideas?  Right now I trying to create a datarow with a new attribute.  Protected Sub grdvSearchlist_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles grdvSearchlist.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then Dim dvr As Data.DataRowView Dim dataItem As Data.DataRowView = e.Row.DataItem dvr = dataItem e.Row.Attributes.Add("argID", dvr(0).ToString()) End If End Sub  

convert column into hyperlink in gridview

hi how can i convert column in grid view into hyperlink  thanks

make onle specific cells in gridview as hyperlink

Dear all,   i have gridview and im displaying the employement history of employee. and im providing a hyperlink in empid to open employee page with update mode ..so that user can update the record. i have an issue here.only if the employeeresigned = "N" empid should be hyperlink, if its "Y" it should not be a hyperlink. How to do this.  <asp:TemplateField HeaderText="empid" SortExpression="empid">   <ItemTemplate> <asp:LinkButton ID="LinkButton1" runat="server" OnCommand ="empDetails_disp" Text='<%# Eval("empid") %>' CommandArgument='<%# Eval("empid", "{0}") %>' ForeColor="#0000C0"></asp:LinkButton> </ItemTemplate> </asp:TemplateField> am wondering how to do this 1) shall i replace all the linkbutton with label if the resignedstatus = "Y" - how to do this? 2) or shall i make the empid as boundfields instead of templatefields and write code on rowbound...with checkin that if resigned = "Y" then e.Row.Cells(0).BackColor = Drawing.Color.blue  e.Row.Cells(0).Attributes.Add("onclick", "empDetails_disp")  e.Row.Cells(0).Attributes.Add("class", "statusclass") ...... in this case i can use only javascript fu

Gridview itemtemplate hyperlink

Can any help me I am facing a problem where I have to  set  Gridview itemtemplate hyperlink dynamically. Thanks

Hyperlink in GridView



           Here is my html

            <asp:HyperLink runat="server" ID="HyperLink1" NavigateUrl='<%# string.Format("Tiff.aspx?ID={0}", Eval("ID")) %>' Target="_blank" Text="View" ></asp:HyperLink>

I m getting an exception Like This..

DataBinding: 'System.Collections.Hashtable' does not contain a property with the name 'ID'.

Clicking a GridView hyperlink to go to another WizardStep


Within a WizardStep in the AccountManagement.aspx page, I have the following Gridview:

                            <asp:GridView ID="GridViewUserAccounts" 
                                <AlternatingRowStyle BackColor="#EEEEEE" />
                                    <asp:HyperLinkField DataNavigateUrlFields="UserName" DataTextField="UserName" 
                                        HeaderText="User ID" />
                                    <asp:BoundField DataField="Email" HeaderText="Email" />

When a UserName HyperLinkField is clicked, I want to go to the another WizardStep.

With DataNavigateUrlFormatString="AccountManagement.aspx?user={0}, I think the page

Passing multiple parameter in NavigateUrl (hyperlink) in GridView




Have created a gridview with a hyperlink column (in template)  in it.

I need to pass 3 or 4 values to the web form by clicking hyperlink column in gridview.


I have managed to pass a single value to web form.



<asp:HyperLink Runat="server" ID="hlDividents" NavigateUrl='<%# Eval("Dividents", "TreatyRuleDetail.aspx?Rate={0}") %>' Text='<%# Eval("Dividents") %>

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.

GridView Paging Using Ajax 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.

Displaying Row Details Tooltip on GridView using JQuery

Continuing exploring JQuery! I decided to implement a feature to display some kind of details related to a row displayed on GridView. For example when displaying employees details on GridView some information might not fit in the GridView because it will make it huge and wide. These infomration can be diplayed as Tooltip. Or when you want to display a picture and some kind of formated text to be diplayed as tooltip when mouse hover on the image.
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