利用用户控件做了个在线投票,可是出错了,出错的代码是这句的ClientScript,难道asp.net中没有这个方法吗,有怎么改,没有的话怎么改
 ClientScript.RegisterStartupScript(this.GetType(), "", "alert('投票成功,谢谢您的参与!');", true);

解决方案 »

  1.   

    System.Web.UI.Page才有
    this.Page.ClientScript.RegisterClientScriptBlock
      

  2.   

     this.page.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('投票成功,谢谢您的参与!');", true);
      

  3.   

    你加上<script></script>试试,也就是把你的句代码改成:
    ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('投票成功,谢谢您的参与!');</script>", true);