Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

Solved VB - help adding text to dynamic element

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

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.
Question by:elliottbenzle
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 12

Accepted Solution

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

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.

Author Closing Comment

ID: 36580875
Thanks again

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

721 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