C# 中如何解决 CS0618 警告

发布时间: 更新时间: 总字数:223 阅读时间:1m 作者: IP上海 分享 网址

C# 中如何解决 CS0618 警告

问题

C#中使用:

          Response.Write("

有时会引起弹框变形,于是找到了一下解决方案但会有错误提示:

本错误提示主角要是运用了已经过时的代码:

          RegisterClientScriptBlock("", "G:\web\personal\manage_diary_o_v.aspx.cs(79,13): 警告CS0618: “System.Web.UI.Page.RegisterClientScriptBlock(string,string)”已过时:“The recommended alternative is ClientScript.RegisterClientScriptBlock(Type type, string key, string script). http://go.microsoft.com/fwlink/?linkid=14202”

解决方案

建议修改如下:

         ClientScript.RegisterStartupScript(this.GetType(), "",

就可以解决本错误。

Home Archives Categories Tags Statistics
本文总阅读量 次 本站总访问量 次 本站总访客数