Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

asp.net VB - help adding text to dynamic element

Posted on 2011-09-21
3
Medium Priority
?
209 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 2000 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

773 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