473,480 Members | 1,873 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Problem with Eval() function inside a Template

Hi there,

I have a HyperLink control inside a DataList's ItemTemplate:

<asp:DataList ID="lstDatos" runat="server">
<ItemTemplate>
<asp:HyperLink ID="lnkName" runat="server" CssClass="Link"
Text='<% #Eval("NAME") %>'
NavigateUrl="repInTransitByProvider.aspx?id=<% #Eval('ID') %>">
</asp:HyperLink>
</ItemTemplate>
</asp:DataList>

Eval() works correctly for the "Text" property, displaying the proper name
at runtime.

However, Eval() fails for the "NavigateUrl" property. At runtime, the
resulting hyperlink is exactly like this:

http://localhost:/repInTransitByProvider.aspx?id=<% #Eval('ID') %>

¿Any ideas on what might be happening here?

Regards,

-Benton
Mar 30 '06 #1
1 1700
when you use a binding expression for a property value, its all that can be
in the value specification.

NavigateUrl = "<%# someexpression %>" is legal binding expression
NavigateUrl = "text<%# someexpression %>" is not a binding expression (just
text)
-- bruce (sqlwork.com)

"Benton" <no@spam.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
Hi there,

I have a HyperLink control inside a DataList's ItemTemplate:

<asp:DataList ID="lstDatos" runat="server">
<ItemTemplate>
<asp:HyperLink ID="lnkName" runat="server" CssClass="Link"
Text='<% #Eval("NAME") %>'
NavigateUrl="repInTransitByProvider.aspx?id=<% #Eval('ID') %>">
</asp:HyperLink>
</ItemTemplate>
</asp:DataList>

Eval() works correctly for the "Text" property, displaying the proper name
at runtime.

However, Eval() fails for the "NavigateUrl" property. At runtime, the
resulting hyperlink is exactly like this:

http://localhost:/repInTransitByProvider.aspx?id=<% #Eval('ID') %>

¿Any ideas on what might be happening here?

Regards,

-Benton

Mar 30 '06 #2

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

Similar topics

5
8702
by: tascien | last post by:
I am just wondering... can footertemplate hold data? b/c i want to show the sum of my Invoice in footer template. How can i do that? I could add the sum to the dataset like this: SumColumn =...
10
1751
by: Lionel B | last post by:
Greetings, I cannot figure out why the following code does not compile: --- BEGIN CODE --- typedef double ftype(double); struct A {
2
3136
by: Billy | last post by:
I want to make a calendar and add a hyperlink to the days inside the calendar. The source code is below: <body> <SCRIPT LANGUAGE="JavaScript"> var now = new Date();
4
1933
by: Antonio Carpentieri | last post by:
Hi all, in my previous post I've wrong typed some tems.. this is the corrected post. in a aspx page I have a repeater like this: <asp:repeater id=repeaterResults runat="server"...
7
4334
by: Lorenzino | last post by:
Hi, I have a problem with bindings in a formview. I have a formview; in the insert template i've created a wizard control and inside it i have an HTML table with some textboxes bound to the...
18
3295
by: len.hartley | last post by:
Hi, I am trying to pop-up a window when the user clicks on an image. The problem is that when the user clicks on the image and the window pops up OK, but the window underneath also proceeds to...
3
3034
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=" &...
4
1651
by: Immortal_Nephi | last post by:
You have written several global functions inside header code. Then, you create either static library or dynamic linked library. All global functions can be reuseable to the main() function when...
0
7041
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
6908
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
7081
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
6737
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
6921
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
4481
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
2995
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
2984
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1300
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 ...

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.