andyw27
asked on
Help with combining encodeURIComponent() with Mailto (Gridview)
Hello,
I have the following within a gridview.
This kinds of works up until <%# Eval("Description") %> contains a special character, i.e. %
I need to preserve this. I read this could be done by using encodeURIComponent(). I found an example of this:
<script language="JavaScript"><doc ument.writ e("<a href=\"mailto:recipient@ex ample.com? subject=" + encodeURIComponent("When, when is now? (if \"now\" is here)") + "\">mail me!</a>")</script>
However I can’t seem to apply it succesfully to my code. Can anyone help please?
I have the following within a gridview.
<asp:TemplateField>
<ItemTemplate>
<a href='mailto: <%# Eval("email") %> ?Subject=Notification <%# Eval("Number")%> - <%# Eval("Description") %> '>
Send Notification</a>
</ItemTemplate>
</asp:TemplateField>
This kinds of works up until <%# Eval("Description") %> contains a special character, i.e. %
I need to preserve this. I read this could be done by using encodeURIComponent(). I found an example of this:
<script language="JavaScript"><doc
However I can’t seem to apply it succesfully to my code. Can anyone help please?
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 for the suggestions, I'll give this a go.
Open in new window