473,395 Members | 2,689 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,395 software developers and data experts.

HyperLinkColumn and NavigateUrl

Hello,

Why is this:
<%# DataBinder.Eval(Container.DataItem, "Id") %>
not working? (I see this in the url... I want to see the id as value)

Complete code:
<asp:HyperLinkColumn DataTextField="From" HeaderText="Van"
NavigateUrl='~/MailMessage.aspx?id=<%# DataBinder.Eval(Container.DataItem,
"Id") %>' SortExpression="From">
</asp:HyperLinkColumn>

Thanks!

Nov 16 '05 #1
2 5709

"Arjen" <bo*****@hotmail.com> wrote in message
news:c5**********@news5.tilbu1.nb.home.nl...
Hello,

Why is this:
<%# DataBinder.Eval(Container.DataItem, "Id") %>
not working? (I see this in the url... I want to see the id as value)

Complete code:
<asp:HyperLinkColumn DataTextField="From" HeaderText="Van"
NavigateUrl='~/MailMessage.aspx?id=<%# DataBinder.Eval(Container.DataItem,
"Id") %>' SortExpression="From">
</asp:HyperLinkColumn>


Hi,

The aspnet newsgroup would probably be more appropriate for ASP.NET
questions.

Anyway, you need to add the runat="server" attribute. Also note that the <%#
tag is evaluated when you call DataBind for the page or the control. For
more information, check out this tutorial:

http://samples.gotdotnet.com/quickst...tabinding.aspx

Regards,
Sami
Nov 16 '05 #2
Hi Arjen

you forgot a single SUPER IMPORTANT value
runat=server

Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Arjen" <bo*****@hotmail.com> wrote in message
news:c5**********@news5.tilbu1.nb.home.nl...
Hello,

Why is this:
<%# DataBinder.Eval(Container.DataItem, "Id") %>
not working? (I see this in the url... I want to see the id as value)

Complete code:
<asp:HyperLinkColumn DataTextField="From" HeaderText="Van"
NavigateUrl='~/MailMessage.aspx?id=<%# DataBinder.Eval(Container.DataItem,
"Id") %>' SortExpression="From">
</asp:HyperLinkColumn>

Thanks!

Nov 16 '05 #3

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

Similar topics

0
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"...
2
by: Maziar Aflatoun | last post by:
Does anyone know how I can using <asp:HyperLinkColumn> have the same caption and point to different URLs? (where the url is id=1,2,3,4,5) Thank you Maz.
3
by: TJS | last post by:
how can I encrypt the querystring values for a HyperLinkColumn ? in example below I would like to encrypt value for field1 ======================================================...
1
by: Rob Meade | last post by:
Hi all, I have just added a hyperlink column to my datagrid - however I am having some troubles getting it to behave as I would like... My objective is to have a hyperlink that I can click on...
5
by: sincethe2003 | last post by:
Hi, in the following example: ----------- <asp:HyperLinkColum HeaderText="Select an Item" DataNavigateUrlField="IntegerValue" DataNavigateUrlFormatString="detailspage.aspx?id={0}"...
4
by: Chris | last post by:
I've tried several posting examples to no avail. I'm trying to pass two parameters to the hyperlink inside of the grid. I've gone to this link that was posted, and besides the typo (missing '>') I...
10
by: tshad | last post by:
I have a Datagrid with a column: <asp:HyperLinkColumn DataTextField="JobTitle" DataNavigateUrlField="PositionID" DataNavigateUrlFormatString="AddNewPositions.aspx?PositionID={0}"...
2
by: Sonny Sablan | last post by:
I am trying to set two querystring variables in a HyperLinkColumn's DataNavigateUrlFormatString... I am aware of HeaderText="Name" DataNavigateUrlField="i" DataTextField="n"...
3
by: Jl_G_0 | last post by:
Hey all, I need to add a hyperlinkcolumn to a datagrid, but the path (DataNavigateUrlFormatString) is dynamic, since the page lists files in directories. The folder name to list is stored in a...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...
0
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
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...
0
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...

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.