当前位置: 代码迷 >> ASP.NET >> 怎么禁止&自动变成&amp
  详细解决方案

怎么禁止&自动变成&amp

热度:8117   发布时间:2013-02-25 00:00:00.0
如何禁止&自动变成&
后台添加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>"试试
  相关解决方案