[thelist] Using multiple script languages in .NET

Gary McPherson genyus at ingenyus.net
Thu Nov 27 00:40:16 CST 2003


thelist-bounces at lists.evolt.org wrote:
> Question:
> How do you include a script function that differs from your
> App's base language in ASP.NET?
> 
> Why:
> I am trying to escape a string of text in a VB.NET page, then
> unescape that string using client-side JS. Urlencode and
> Htmlencode don't seem to mesh well with client-side
> unescapes. I would also like to find out more about
> Multi-language scripting in .NET.
> 
> Example: in ASP Classic
> --------------
> <script language="javascript" runat="server">
>     function jsEscape(textString){ return escape(textString); }
>     </script> <% Dim strHTML
>     strHTML = " A whole grip of Html Tags :) "
>     Response.Write " var strHTML = ' " & jsEscape(strOutPut) & _
>         " '; sHTML = unescape(strHTML); document.write(strHTML); " %>
> --------------

You cannot mix languages within a single ASP.NET page. Could you provide
an example string which you have attempted to escape/unescape and the
results you achieved using the mix of client/server functions? I've
never tried mixing the two in this way, but I've used both independently
and off the top of my head, they both produce similar results.

All the best,

Gary




More information about the thelist mailing list