参考:
http://dotnet.aspx.cc/ShowDetail.aspx?id=49ML4AO8-5PB3-4KNY-NJZD-LJOIOXV4M1X4

解决方案 »

  1.   

    string strjs = "<script language=javascipt>";
    strjs+="function mimi()";
    strjs+="{ alert('fuck')";
    strjs+="}</script>";
    this.RegisterClientScriptBlock("myjs",strjs);
    他是page类的一个方法,一般不用再引用命名空间
    他的命名空间是System.Web.UI
      

  2.   

    没有别的办法,你只能把Page当作参数传到你的class里
    要么你就直接用 System.Web.HttpContext.Current.Response.Write("<script .....</script>");
      

  3.   

    System.Web.HttpContext.Current.Page.RegisterClientScriptBlock你事先要在引用里添加System.Web.dll
      

  4.   

    我已经引用了system.web.dll,但是出现:
    "Reference to a non-shared member requires an object reference."
      

  5.   

    只好用這個:
    xxdneu(xxd) ( ) 信誉:89  2004-06-28 10:59:00  得分: 0  
     
     
       没有别的办法,你只能把Page当作参数传到你的class里
    要么你就直接用 System.Web.HttpContext.Current.Response.Write("<script .....</script>");