Solved

asp.net VB - help adding text to dynamic element

Posted on 2011-09-21
3
202 Views
Last Modified: 2012-05-12
On my page I have this code:
<asp:TemplateField HeaderText="Document" >
     <ItemTemplate>
<asp:HyperLink  
text='<%# Eval("doc_loc") %>'  
navigateurl='<%# Eval("doc_loc") %>' target='_blank' runat='server' />
</asp:HyperLink>
    </ItemTemplate>
</asp:TemplateField>

I want to add a folder to the 'navigateurl' element so that     /pdf/       goes before the  <%# Eval("doc_loc") %>

What is the correct syntax to do this? I tried
navigateurl='"/pdf/"<%# Eval("doc_loc") %>'

but got an error.

Thanks for any help.
0
Comment
Question by:elliottbenzle
3 Comments
 
LVL 12

Accepted Solution

by:
Ramkisan Jagtap earned 500 total points
ID: 36578285
Hi,
Try this out,
navigateurl="~/pdf/<%# Eval("doc_loc") %>"
OR
navigateurl='<%# "~/pdf/"+ Eval("doc_loc") %>'


Regards,
Ram
0
 
LVL 16

Expert Comment

by:Easwaran Paramasivam
ID: 36578359
Try wiht navigateurl ="/pdf/" + <%# Eval("doc_loc") %>.

If it is not working give relative path "~/pdf/" + <%# Eval("doc_loc") %>. Or better absolute path of the folder.
0
 
LVL 4

Author Closing Comment

by:elliottbenzle
ID: 36580875
Thanks again
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question