Dynamically setting file name in a hyperlink

A

Anne Butera

I want to set a navigate URL to include the name of a file, that is derived
from a field from the SQL query. I get "Server Tag is not well formed" when
I try to run this:

<asp:HyperLink ID="hyperlink" runat="server" NavigateUrl="\\server\share\"
'<%# Eval("storeNumber")'%> ".doc" >config1</asp:HyperLink>

I want the url to be \\server\share\3.doc

Can someone please tell me what I am doing wrong, or is there a better way
to do this?

Thank you for your time

Ann
 
M

Mark Fitzpatrick

Ann,

If you look at the NavigateUrl attribute, you have a bunch of single and
doublequotes. You're going to end up with somethign that looks like this

\\server\share"'3".doc"

Try something like this
<asp:HyperLink ID="hyperlink" runat="server"
NavigateUrl="\\server\share\ said:
config1</asp:HyperLink>
 
A

Anne Butera

Thank you for your reply.

So I tried your suggetions, and now I'm able to run the form and click the
hyperlink, but the url looks like this:

\\server\share\<%# Eval("storeNumber") %>.doc

Here's the code I used:

<asp:HyperLink ID="HLconfig1" runat="server" NavigateUrl='\\server\share\<%#
Eval("storeNumber") %>.doc'>config1</asp:HyperLink>


Do you have any other suggestions? Thank you for your time.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top