elliottbenzle
asked on
asp.net VB - help adding text to dynamic element
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.
<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.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks again
If it is not working give relative path "~/pdf/" + <%# Eval("doc_loc") %>. Or better absolute path of the folder.