469,889 Members | 1,394 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,889 developers. It's quick & easy.

Href and <%# DataBinder.Eval(Container.DataItem, "Name") %> ?

Hi

In my aspx page HTML I have

<a href='<%# DataBinder.Eval(Container.DataItem, "Name") %>'> <%#
DataBinder.Eval(Container.DataItem, "Name") %>

I am trying to create a hyperlink to
applicationroot\FileUploads\Filename.FileExtension .

At the moment it instead generates

http://localhost/MyWebApplication/Th....FileExtension .

If I try

<a href="~/FileUploads/"'<%# DataBinder.Eval(Container.DataItem, "Name")
%>'> <%# DataBinder.Eval(Container.DataItem, "Name") %>

it generates

http://localhost/MyWebApplication/Th....FileExtension

whereas I want

http://localhost/MyWebApplication/Fi....FileExtension

Any suggestions?

Thanks!

Lauchlan M

Nov 17 '05 #1
1 6368
Figured it out.

<a href='<%# Server.MapPath("~/FileUploads/")%>
<%# DataBinder.Eval(Container.DataItem, "Name") %>'>
<%# DataBinder.Eval(Container.DataItem, "Name") %>
</a>

For anyone who'se interested.

Lauchlan M
Nov 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Mark | last post: by
1 post views Thread by Waqarahmed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.