473,385 Members | 1,347 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,385 software developers and data experts.

Using database field as link

I have database that has one table with 2 columns ie Name and Link. I
have a page that links to the dynamic page using a query string.
The results of the query are displayed on a datagrid.

QUESTION: How do i make the text in the 'Link' Column a live link that
users can click?

Oct 24 '06 #1
1 1241

<ro**********@gmail.comwrote in message
news:11**********************@m73g2000cwd.googlegr oups.com...
>I have database that has one table with 2 columns ie Name and Link. I
have a page that links to the dynamic page using a query string.
The results of the query are displayed on a datagrid.

QUESTION: How do i make the text in the 'Link' Column a live link that
users can click?
I'm assming your binding to the grid, so If you define
AutoGenerateColumns="false" you can specifiy the columns and their format
manually and use a hyperlink field on the column definition.
<asp:GridView ID="GridView1" runat="server"
OnPageIndexChanging="bound_PageIndexChanging"
PageSize="5"
AllowPaging=true
AutoGenerateColumns="false"
showheader="true"
CaptionAlign="Top"
RowHeaderColumn="ProductName"
BorderWidth="0px"
CellPadding="5"
TabIndex="5"
PagerSettings-Mode="Numeric"
>
<HeaderStyle CssClass="sidebar-maintitle-dark" />
<RowStyle CssClass="MyHlStyle" />
<PagerStyle HorizontalAlign="Right"
CssClass="sidebar-maintitle-dark" />
<Columns>
<asp:BoundField ControlStyle-CssClass="MyHlStyle"
HeaderText="Title" DataField="title" ReadOnly="true" />
<asp:HyperLinkfield ItemStyle-CssClass="MyHlStyle"
DataNavigateUrlFields="link" DataTextField="description"
HeaderText="Description &amp; URL" />
</Columns>
</asp:GridView>

or you could use a templatefield

http://apnasaathi.blogspot.com/2006/09/datagrid.html

--
--
Regards

John Timney (MVP)
VISIT MY WEBSITE:
http://www.johntimney.com
http://www.johntimney.com/blog
Oct 24 '06 #2

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

Similar topics

8
by: Adam Nemitoff | last post by:
Is is possible to construct a SELECT statement that contains a WHERE clause that uses the value from a column in the "next" row? ie. given a table with a single field named "myField" with the...
3
by: Random Person | last post by:
Does anyone know how to use VBA to relink tables between two MS Access databases? We have two databases, one with VBA code and the other with data tables. The tables are referenced by linked...
3
by: cassandra.flowers | last post by:
I'm designing a database because I have to do it for the preperation work for my A-Level ICT exam. The database is for a building company. It has to store information on building projects...
6
by: Wendy Powley | last post by:
I have a subform which represents a 1:N relationship with the main form. I would like to be able to read values from an external file, fill the subform with the values read & allow the user to...
1
by: Daveyk0 | last post by:
Hello there, I have a front end database that I have recently made very many changes to to allow off-line use. I keep copies of the databases on my hard drive and link to them rather than the...
5
by: Slant | last post by:
Here's a question that most will have different answers to. I'm just dying to find a solution that seems halfway automated!! There really are two seperate issues which might be answered by the...
0
by: balean | last post by:
Hi guys, I need help. I am trying to extract data from XML file. I am using all the fucntions needed to parse the xml data every thing working fine, but what I am looking for is to take the string...
10
by: ARC | last post by:
Hello all, General question for back-end database that has numerous date fields where the database will be used in regions that put the month first, and regions that do not. Should I save a...
221
Atli
by: Atli | last post by:
You may be wondering why you would want to put your files “into” the database, rather than just onto the file-system. Well, most of the time, you wouldn’t. In situations where your PHP application...
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.