Navigate URL in hyperlink doesnt render to a URL

Camillia
Camillia used Ask the Experts™
on
I have the a hyperlink below with a navigate URL. I need to add that patientID.
When I bring up the page, that URL "File Upload" is plain text.  I looked at view source and i dont see the hyperlink.

This is what I have:
 <asp:HyperLink runat="server" Text="File Upload" NavigateUrl='<%#"~/Main/FileUpload/DefaultFile.aspx?pageTitleId=39&patient=" + Eval("PatientPhone") %>' ID="hlFile"></asp:HyperLink>

Open in new window


This is how it renders:

<a id="DashboardContentPlaceHolder1_hlFile">File Upload</a>

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Paul JacksonSoftware Engineer
Top Expert 2011

Commented:
try :

<asp:HyperLink runat="server" Text="File Upload" NavigateUrl='<%#Eval("PatientPhone","~/Main/FileUpload/DefaultFile.aspx?pageTitleId=39&patient={0}")%>' ID="hlFile"></asp:HyperLink>
                

Open in new window

hmm, no didnt work. I dont see a hyperlink.
double quotes work?

NavigateUrl="<%#"~/Main/FileUpload/DefaultFile.aspx?pageTitleId=39&patient=" + Eval("PatientPhone") %>"
Software Engineer
Top Expert 2011
Commented:
Try this :

<asp:HyperLink runat="server" Text="File Upload" NavigateUrl='<%# string.format("~/Main/FileUpload/DefaultFile.aspx?pageTitleId=39&patient={0}", Eval("PatientPhone")) %>' ID="hlFile"></asp:HyperLink>

Open in new window

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial