473,320 Members | 1,961 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Hyperlink in Gridview

Hi all,
am working on asp.net 2.0, c#

am using a gridview and hyperlink field in that
am displaying id also
on clicking hyperlink i have to pass that id as query string parameter

i tried with following code but not success
plz check

Expand|Select|Wrap|Line Numbers
  1. <asp:TemplateField Visible="False">
  2.  <ItemTemplate>
  3.    <asp:Label ID="Lblid" runat="server" Text='<%# 
  4. DataBinder.Eval(Container.DataItem, "fld_Sid") %>'></asp:Label>
  5.   </ItemTemplate>
  6.  </asp:TemplateField>
  7.  
  8.  
  9. <asp:HyperLinkField  HeaderText="View" 
  10. NavigateUrl="~/EMP/viewProfile.aspx?id={}"   />
with in {} i have to put Lblid value

Plz reply me urgent

Thanks Inadvance
Aug 26 '08 #1
2 1010
Plater
7,872 Expert 4TB
I've only ever done it in code, not in the designer. Not sure how you would get around that.
Are there any examples out there on the web?
Aug 26 '08 #2
dmj07
55
Create the hyperlink filed into the gridviews columns like below:

Expand|Select|Wrap|Line Numbers
  1. <asp:GridView ID="GridView1" runat="server" AllowSorting="True" AutoGenerateColumns="False" CellPadding="1" DataKeyNames="Reject_ID" DataSourceID="SqlDataSourceAmend" EnableSortingAndPagingCallbacks="True">
  2. <Columns>             
  3. <asp:HyperLinkField DataTextField="ID" HeaderText="Reject ID" DataNavigateUrlFields="ID" 
  4. DataNavigateUrlFormatString="Form.aspx?RejectNo={0}"
  5. SortExpression="ID" />
  6. </asp:Gridview>
  7.  
  8.  

The DataNavigateUrlFormatString property will take you to a desired page withe the text in the hyperlink specified in the query string by the "{0}"
Aug 26 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: willip | last post by:
I have a Gridview control with a Databound Hyperlink. e.g.: <asp:HyperLinkField HeaderText="MyTitle" DataNavigateUrlFields="MyID" DataNavigateUrlFormatString="~/ShowMe.aspx?MyID={0}"...
3
by: William LaMartin | last post by:
I have a gridview (with no properties set) on an aspx page which I populate from an XML file with the code below. The data in the XML file looks like this <description>National Trust for...
4
by: =?Utf-8?B?QW1pciBUb2hpZGk=?= | last post by:
Hi I have a GridView that is displaying master records. Some of these records have child records. I would like to a column to my master GridView such that for each master record that has...
1
by: Paul W Smith | last post by:
The text below is a GridView I am trying to use to display some data from a database. I am using one templatefield of grid because I want the contents of the record fields to appear on three...
1
by: Author | last post by:
I got into trouble with this problem. The data I am presenting in a GridView control has a column called "Website". That data comes from a stored procedure in SQL Server 2000. Most of them...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.