473,503 Members | 1,749 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

hyperlinks in gridview

In my gridview i need to add hyper links but add them as such

headers - - -- ---------------------------------------------
-------------------------------------------------------------
link1 BMW 2005 25,000
link2
----------------------------------------------------------------
link1 Lexus 1996 12,000
link2

link1 url: details.aspx?id=123&carMake=BMW
link2 url: salesman.aspx?id=12&date=5/5/2006

how can i accomplish this in the gridview?

Aug 18 '06 #1
3 1200
adding a templateHeader and the content would be something like

<asp:buttonlink id="lnk1" runat="server"
text='<%# Eval("yourCarMake") %>'
postbacknavigation='<%# string.format("details.aspx?id={0}&car={1}",
Eval("yourCarID"), Eval("yourCarMake") ) %>'
I dont know by heart the "postbacknavigation" (and I dont want to open VS2k5
just to see that :-) ) but it's something like it, the rest is ok, try it.
--

Bruno Alexandre
"a Portuguese in Københav, Danmark"

"CSharpguy" <CS*******@discussions.microsoft.comescreveu na mensagem
news:88**********************************@microsof t.com...
In my gridview i need to add hyper links but add them as such

headers - - -- ---------------------------------------------
-------------------------------------------------------------
link1 BMW 2005 25,000
link2
----------------------------------------------------------------
link1 Lexus 1996 12,000
link2

link1 url: details.aspx?id=123&carMake=BMW
link2 url: salesman.aspx?id=12&date=5/5/2006

how can i accomplish this in the gridview?

Aug 18 '06 #2
I got the link1 working but how can I add link2 under link2? I don't want
another column for link to, I want both links in the same column. Would I do
the templateheader to do that or no?

"Bruno Alexandre" wrote:
adding a templateHeader and the content would be something like

<asp:buttonlink id="lnk1" runat="server"
text='<%# Eval("yourCarMake") %>'
postbacknavigation='<%# string.format("details.aspx?id={0}&car={1}",
Eval("yourCarID"), Eval("yourCarMake") ) %>'
I dont know by heart the "postbacknavigation" (and I dont want to open VS2k5
just to see that :-) ) but it's something like it, the rest is ok, try it.
--

Bruno Alexandre
"a Portuguese in Københav, Danmark"

"CSharpguy" <CS*******@discussions.microsoft.comescreveu na mensagem
news:88**********************************@microsof t.com...
In my gridview i need to add hyper links but add them as such

headers - - -- ---------------------------------------------
-------------------------------------------------------------
link1 BMW 2005 25,000
link2
----------------------------------------------------------------
link1 Lexus 1996 12,000
link2

link1 url: details.aspx?id=123&carMake=BMW
link2 url: salesman.aspx?id=12&date=5/5/2006

how can i accomplish this in the gridview?


Aug 18 '06 #3
forogot about link 2 :-D

just add the samething with <br/so it will change line:

<asp:buttonlink id="lnk1" runat="server"
text='<%# Eval("yourCarMake") %>'
postbacknavigation='<%# string.format("details.aspx?id={0}&car={1}",
Eval("yourCarID"), Eval("yourCarMake") ) %>' />
<br/>
<asp:buttonlink id="lnk2" runat="server"
text='<%# Eval("yourCarMake") %>'
postbacknavigation='<%# string.format("salesman.aspx?id={0}&date={1}",
Eval("salesID"), Eval("date") ) %>' />
--

Bruno Alexandre
"a Portuguese in Københav, Danmark"

"CSharpguy" <CS*******@discussions.microsoft.comescreveu na mensagem
news:99**********************************@microsof t.com...
>I got the link1 working but how can I add link2 under link2? I don't want
another column for link to, I want both links in the same column. Would I
do
the templateheader to do that or no?

"Bruno Alexandre" wrote:
>adding a templateHeader and the content would be something like

<asp:buttonlink id="lnk1" runat="server"
text='<%# Eval("yourCarMake") %>'
postbacknavigation='<%# string.format("details.aspx?id={0}&car={1}",
Eval("yourCarID"), Eval("yourCarMake") ) %>'
I dont know by heart the "postbacknavigation" (and I dont want to open
VS2k5
just to see that :-) ) but it's something like it, the rest is ok, try
it.
--

Bruno Alexandre
"a Portuguese in Københav, Danmark"

"CSharpguy" <CS*******@discussions.microsoft.comescreveu na mensagem
news:88**********************************@microso ft.com...
In my gridview i need to add hyper links but add them as such

headers - - -- ---------------------------------------------
-------------------------------------------------------------
link1 BMW 2005 25,000
link2
----------------------------------------------------------------
link1 Lexus 1996 12,000
link2

link1 url: details.aspx?id=123&carMake=BMW
link2 url: salesman.aspx?id=12&date=5/5/2006

how can i accomplish this in the gridview?



Aug 18 '06 #4

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

Similar topics

1
1256
by: Don | last post by:
In my code I'm dynamically creating a GridView control and binding it to a DataView object that I create form a DataSet that I get from a web service call. It seems that no matter what I do I can...
1
1178
by: Ram | last post by:
Hi, I am using hyperlink column in the gridview control. When I click any of the hyperlinks , the values appear in the Url, which can be tampered easily. How I can pass values to the next...
2
4498
by: Jared | last post by:
Hi I have been trying to find an easy way to strip the hyperlinks out of an html string to make exporting ASP.NET GridView's to Excel a bit more user friendly. Couldn't find anything in these...
8
1481
by: fiefie.niles | last post by:
I am new to ASP.Net. I use VB.NET as the language and Visual Studio ..NET 2003. On my WebForm I have a label called "Categories". I would like to read all the categories from the database and...
4
3047
by: Bill | last post by:
Say I want to pull a bunch of records from a contacts database into a gridview and one of the fields contains an email address. Now suppose I want to make that email address clickable by putting it...
1
3059
by: mailsazmat | last post by:
I am working on the gridview which is populated by the MS Access database. i want to get the data being populated in the gridview as hyperlinks. I dont want to add a new column in the gridview. ...
2
2869
by: =?Utf-8?B?S3VtYXIuQS5QLlA=?= | last post by:
HI I want to disable the underline of a hyperlink text in a hyperlink column of datagrid/gridview in the content page. If I am writing a css class to disable it in the master page then its...
2
1107
by: Jonathan | last post by:
In the sample code below, how do I make the various text items in a datagrid column have a clickable hyperlinks? e.g. Ford Mustang should be a link to www.mysite.com/mustang.htm </head>
0
1167
by: jm | last post by:
Hi, I have this and it works (I get output in my gridview): string filePaths = Directory.GetFiles(@"C:\mydirectory\", "*.pdf", SearchOption.AllDirectories); GridView1.DataSource = filePaths;...
0
7202
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7086
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7280
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,...
0
7460
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...
0
5578
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,...
0
4672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1512
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
736
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
380
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.