473,661 Members | 2,484 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

databound and hyperlink field needed in gridview

Hi all,

I need a field that it is both databound, and hyperlink in a gridview. That
is, the value is obtained from a query, and at the same time needs to point
to a new page where
will be used to make another query. How can this be possible in asp .net?

Thanks in advance,

Carlos.

Jun 7 '06 #1
1 2094
On Wed, 7 Jun 2006 11:00:25 -0400, "Carlos" <ch******@yahoo .com>
wrote:
Hi all,

I need a field that it is both databound, and hyperlink in a gridview. That
is, the value is obtained from a query, and at the same time needs to point
to a new page where
will be used to make another query. How can this be possible in asp .net?

Thanks in advance,

Carlos.


Hi Carlos,

I'd suggest adding another column to your gridview of type
TemplateField. It would look something like what is below. id is a
column in my database table referenced in gridview's datasource.

....
<asp:BoundFie ld DataField="aka" HeaderText="aka "
SortExpression= "aka" />
<asp:TemplateFi eld>
<ItemTemplate >
<asp:HyperLin k ID="HyperLink1 "
NavigateUrl='<% #
"http://peterkellner.ne t/downloads?id=" + Eval("id") %>'
runat= "server">GO TO
PETERKELLNER>NE T</asp:HyperLink>
</ItemTemplate>
</asp:TemplateFie ld>
</Columns>
</asp:GridView>
Peter Kellner
http://peterkellner.net
Jun 8 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2663
by: Alex | last post by:
I would like to have one column in my DataGrid that content acts as a hyperlink. In addition to that I would like that the content is databound to a DataSet source. If I create a hyperlink column in VS.NET I loose the databinding feature for that column. If I choose a data bound column I don't get the hyperlink formatting and actions.
9
13898
by: Jakob Lithner | last post by:
1) I have a DataGridView with edit capability. But in some columns I want to limit the input with a DropDownList. There is no inbuilt column for DropDownLists so I intended to add one myself. I thought the TemplateField would be a good candidate so I added a DropDownList in the EditItemTemplate and a Literal in the ItemTemplate, but then I was kind of lost .... It would be convenient to use the DataGridView for all other fields but maybe...
3
4164
by: Bren | last post by:
Hi All VS2005 Gridview control with vb I am populating a gridview of company staff. One of the columns is a hyperlink to a SMS texting facility I have so secrataries can text the managers etc. i.e Secratary loads the page on the intranet, finds the manager they want to contact, clicks on the "SMS" hyperlink and is taken to the SMS page to fill out the message and send it to the manager.
3
3124
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 Historic Preservation</description> <URL>http://www.nthp.org/</URL> <category>Architecture</category> Can anyone tell me why the other two columns are displayed, but the
3
3046
by: shapper | last post by:
Hello, In my GridView I have a HyperLink Field where I set the DataNavigateUrlFormaString MyHyperLinkField.DataNavigateUrlFormatString = "~\RSS.ashx?Channel={0}&Culture=" & System.Threading.Thread.CurrentThread.CurrentCulture.ToString() I believe {0} retrieves the value of my datasource column with index 0.
1
3029
by: Håkan | last post by:
Hi! How do you format the href field of the <a>-tag when you use a databound BulletedList in Hyperlink mode? The field in the database contains an ID that I want to use as a parameter in the url for the Bulletedlists hyperlink tag. /Håkan
1
2516
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 different lines. Everything works except I now want to add an image with which acts as a hyperlink to another page. The querystring to the new page is a field from the database. What I cannot get right is the syntax to build the Hyperlink to the...
2
4991
by: Tor Inge Rislaa | last post by:
When I insert the complete querystring into the NavigateUrl tag this hyperlink works fine within the GridView. <asp:HyperLinkField HeaderText=" Details" NavigateUrl="~/Admindetail.aspx?ku_id=1" Text="Details"
1
3042
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 have valid http urls. But some of them say "None" or "Not available". In the GridView, I would like create a hyperlink for those valid http urls only, and simply plain-output those which say "None" or "Not available".
0
8856
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8762
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8545
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8633
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7365
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6185
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4179
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4347
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1992
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.