![]() |
Equivalent of encodeURIComponent
Hi to All,
I have a page with this code: <%@ Language=VBScript %> <% Option Explicit Dim a_at, a_pj, a_ri, mail ' a_at = Request("a_at") a_pj = Request("a_pj") a_ri = Request("a_ri") Set mail=CreateObject("CDO.Message") mail.To="pluto@libero.it" mail.From="pippo@libero.it" mail.Subject="Project Planning approved!" mail.HTMLBody="Doc. SER-" & a_pj & "-" & a_at & "-P-" & a_ri & " is Approved.<br><br>" mail.Send Set mail=nothing All it' s OK !! I' d like that in the body of the email, the Doc. SER-2012-SGEF-P-01 (SER-2012-SGEF-P-01 is an example, i have chosen a generic possible value for the request variables) has an hyperlink associated if i work in javascript i can solve the problem in this way: location.href = "mailto:"+document.getElementById('service_sign_3').value+"?subject=Project Planning Approved!&body= %0ADoc.: "+encodeURIComponent(location.href)+" is Approved." in ASP there is a special code to obtain a similar thing ?? Thanks a lot in advance !!!! P.S. in my specific case i solved the problem in this way: but my doubt remains ?? Is there a code similar to encodeURIComponent(location.href) <%@ Language=VBScript %> <% Option Explicit Dim a_at, a_ho, a_link, a_pj, a_ri, mail ' a_at = Request("a_at") a_ho = Request.ServerVariables("server_name") a_ri = Request("a_ri") a_link = "http://" & a_ho & "/quality/planning/4_index.asp?p_proj=" & a_pj & "&p_act=" & a_at & "&p_ri=" & a_ri & "" Set mail=CreateObject("CDO.Message") mail.To="pluto@libero.it" mail.From="pippo@libero.it" mail.Subject="Project Planning approved!" mail.HTMLBody="Document: <a href='" & a_link & "'>SER-" & a_pj & "-" & a_at & "-PDS-" & a_ri & "</a> is Approved.<br>" mail.Send Set mail=nothing |
Server.URLEncode(xxx)
There is also Server.HTMLEncode Here: http://msdn.microsoft.com/en-us/libr...(v=vs.90).aspx |
Thanks Old Pedant for your help ...
in my specific case using Server.HTMLencode or Server.URLencode is possible to better the code inside my asp page ?? Specially in mail.HTMLbody ?? |
You typically only use HTMLEncode when you want to *SHOW* HTML code (e.g., tags *AS TEXT*) in a page. As when making an example or tutorial. Much less common thant URLEncode.
|
Thanks a lot Old Pedant for your help ...
So I undestand that in my case the solution is only what I wrote in my first message... Thanks again !!! :D |
| All times are GMT +1. The time now is 04:16 PM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.