1 Replies - 243 Views - Last Post: 25 October 2017 - 01:33 PM Rate Topic: -----

#1 ikhlas06  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 178
  • Joined: 20-May 16

How to add eval inside navigateURL?

Posted 25 October 2017 - 11:37 AM

How to add eval inside navigateURL?


I am using VB asp .net

I did some thing like this but it gives string error.

<asp:TemplateField HeaderText="id" SortExpression="id">
	<ItemTemplate>
		<asp:HyperLink ID="HlFile" runat="server" Text='<%# Eval("id") %>' NavigateUrl="/NotWebLink/ '" & <%# Eval("id") %> & "'"></asp:HyperLink>
	</ItemTemplate>
</asp:TemplateField>



I looked online and they said to do this:

NavigateUrl='<%# Eval("type","~/Refuse.aspx?type={0}") %>'



issue is that its not a normal web link. so I can not do this. I need it in following format:

NavigateUrl="/NotWebLink/ '" & <%# Eval("id") %> & "'"


Is This A Good Question/Topic? 0
  • +

Replies To: How to add eval inside navigateURL?

#2 ikhlas06  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 178
  • Joined: 20-May 16

Re: How to add eval inside navigateURL?

Posted 25 October 2017 - 01:33 PM

alright, I got this string working
NavigateUrl='<%# Eval("type","testPage.aspx?type={0}") %>'


string output is:
testPage.aspx?type=type%20%20/


I am not sure why its putting 2 spaces (%20) and slash (/). is there way for me to get rid of at least 2 spaces?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1