Solved

asp.net VB - help adding text to dynamic element

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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

757 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now