Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 7th, 2007, 04:21 PM
Registered User
 
Join Date: Feb 2007
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default Using Hyperlink field in GridView

I have a table with two fields: UserID and UserName.

In a GridView, I want to display a list of UserNames, with each UserName appearing as a hyperlink:

DataNavigateURLFormatString: destinationpage.aspx?UserID={0}

I have two questions:

1. How do I set the DataFormatTextString to the contents of UserName?
2. How do I hide the UserID and UserName fields from my GridView?

TIA!


 
Old February 7th, 2007, 06:41 PM
Authorized User
 
Join Date: Feb 2007
Posts: 37
Thanks: 1
Thanked 0 Times in 0 Posts
Default

check this one it may help you

http://msconline.maconstate.edu/tuto...pnet07-04.aspx

  To hide field in gridview just set "visible=false" for that template field
e.g
 <asp:TemplateField Visible ="False" HeaderText="RateID">
                  <ItemTemplate>
                       <asp:TextBox id="txtRateID" Visible ="false" Text = '<%# Eval("rate_id") %>' runat="server" Width="50px" Height="15px"></asp:TextBox>
                    </ItemTemplate>
                </asp:TemplateField>
 
Old February 7th, 2007, 07:33 PM
Registered User
 
Join Date: Feb 2007
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you! I got it working exactly the way I wanted it to from your post.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Opening a text file using hyperlink in a gridview absu General .NET 1 March 6th, 2009 02:03 AM
HyperLink in a gridview contro to open word docmen Otoniel ASP.NET Espanol 0 October 7th, 2008 01:11 AM
Replace Gridview field if null with new field Indo77 ASP.NET 2.0 Basics 1 June 18th, 2007 06:22 AM
GridView Hyperlink ki_ki ASP.NET 2.0 Professional 25 March 8th, 2007 03:30 PM
How to display one field as a hyperlink? emccraw Classic ASP Databases 4 September 5th, 2006 04:03 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.