Is there a standard way to encode a .NET string into JavaScript string for use in MS Ajax?

后端 未结 3 1243
庸人自扰
庸人自扰 2020-11-29 05:51

I\'m trying to pass the output of a SQL Server exception to the client using the RegisterStartUpScript method of the MS ScriptManager in .NET 3.5. This works fi

3条回答
  •  难免孤独
    2020-11-29 06:26

    This is an old thread, but you may be interested to know about the Microsoft AntiXSS library which has a Javascript encode method which works for .Net 2 onwards.

    http://msdn.microsoft.com/en-gb/security/aa973814.aspx

提交回复
热议问题