473,512 Members | 14,457 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Mulitple datafields in a template column

Hi folks

This is what I would like to do

<asp:TemplateColumn HeaderText="Purchase Order"><ItemTemplate><asp:HyperLink
runat="server"
Text='<%# DataBinder.Eval(Container, "DataItem.ID1") %>'
NavigateUrl='page.aspx?var1='<%# DataBinder.Eval(Container, "DataItem.ID1") %>'var2='<%# DataBinder.Eval(Container, "DataItem.ID2") %
ID="Hyperlink1"></asp:HyperLink></ItemTemplate></asp:TemplateColumn

What I want to do is build a Hyperlink with 2 variables from the dataset, not just one. Can something like this be done

thx...sonny
Nov 18 '05 #1
1 1073

You are very close, but you probably found out the TemplateColumn does
not have a NavigateUrl property. One solution is to add an anchor tag
yourself:

<asp:TemplateColumn HeaderText="PurchaseOrder">
<ItemTemplate>
<a href='page.aspx?
param1= <%#DataBinder.Eval(Container.DataItem,"ID1")%>
&param2=<%#DataBinder.Eval(Container.DataItem, "ID2")%>'>
<%#DataBinder.Eval(Container.DataItem, "ID1")%>
</a>
</ItemTemplate>
</asp:TemplateColumn>

HTH,

--
Scott
http://www.OdeToCode.com

On Wed, 14 Apr 2004 07:56:03 -0700, "sonny"
<an*******@discussions.microsoft.com> wrote:
Hi folks,

This is what I would like to do:

<asp:TemplateColumn HeaderText="Purchase Order"><ItemTemplate><asp:HyperLink
runat="server"
Text='<%# DataBinder.Eval(Container, "DataItem.ID1") %>'
NavigateUrl='page.aspx?var1='<%# DataBinder.Eval(Container, "DataItem.ID1") %>'var2='<%# DataBinder.Eval(Container, "DataItem.ID2") %>
ID="Hyperlink1"></asp:HyperLink></ItemTemplate></asp:TemplateColumn>

What I want to do is build a Hyperlink with 2 variables from the dataset, not just one. Can something like this be done?

thx...sonny


Nov 18 '05 #2

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

Similar topics

0
4830
by: Jongmin | last post by:
Hi! I am making HyperLinkColumn in datagrid. It is simple to make the hyerlinkcolumn with one datafield. <asp:HyperLinkColumn Text="NAME" DataNavigateUrlField="NAME"...
3
1134
by: | last post by:
How can you get 2 datafields displayed in a combo box, and still return just one of the fields? I need to return a company name in order to help users visually determine who a rep works for, but...
3
281
by: | last post by:
How can you get 2 datafields displayed in a combo box, and still return just one of the fields? I need to return a company name in order to help users visually determine who a rep works for, but...
6
279
by: | last post by:
How can you get 2 datafields displayed in a combo box, and still return just one of the fields? I need to return a company name in order to help users visually determine who a rep works for, but...
1
4596
by: yumbelie | last post by:
Hi, I want to set multiple datafields from a dataset to a single boundcolumn in my gridview, but I can't see any easy way to do this since the DataField property of the boundcolumn takes a single...
0
7254
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
7153
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
7373
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
7432
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...
1
7094
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...
0
5677
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,...
1
5079
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...
0
3230
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...
0
3218
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.