Solved VB - help adding text to dynamic element

Posted on 2011-09-21
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 500 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

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 (…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : All lightning effects with instructions : http://www.mediaf…

624 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