日期:2014-05-17  浏览次数:20503 次

如何禁止&自动变成&
后台添加script标签,前台显示时地址自动变成,
C# code

         string  url = "http://com.m9ms.com/click.aspx?id=9999&logo=3&zhon=中文";      
         System.Web.UI.HtmlControls.HtmlGenericControl script = new System.Web.UI.HtmlControls.HtmlGenericControl("script");
         script.Attributes.Add("type", "text/javascript");
         script.Attributes.Add("src", url);
         script.Attributes.Add("charset", "gb2312");
         this.form1.Controls.Add(script);


最终HTML就是这样
JScript code
 <script type="text/javascript" src="http://com.m9ms.com/click.aspx?id=9999&amp;logo=3&amp;zhon=中文" charset="gb2312"></script>


http://com.m9ms.com/click.aspx?id=9999&logo=3&zhon=中文

http://com.m9ms.com/click.aspx?id=9999&amp;logo=3&amp;zhon=中文





------解决方案--------------------
你可以加一个Literal控件,设置Text=@"<script type=""text/javascript"" src=""http://com.m9ms.com/click.aspx?id=9999&logo=3&zhon=中文"" charset=""gb2312""></script>"试试