always there for you

善于生活,善于学习,这是我和你的目标.

« Rar挂马Visual Web Developer创建多语言网站初体验 »

在客户端注册脚本-.Net

   .Net 向客户端注册脚本的三种方法,比较菜,放在Blog里随时查看:

    1.使用literal控件在页面任意位置注册脚本

       例如:

          <asp:literal ID="cScript" runat="server"></script>

      cs文件里:

            cScript.Text += "<script>alert('always there's Blog');</script>";

    2.使用Response.Write在页面顶部注册脚本.

            Response.Write("script语句");

    3.使用ClientScript.RegisterClientScriptBlock()和ClientScript.RegisterStartupScript()在表单开始和结束的地方注册脚本
          
           ClientScript.RegisterClientScriptBlock(Page.GetType(),"","<script>alert('God Like!!!')</script>");

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

日历

最新评论及回复

最近发表

Copyright www.alwaysthere.com.cn . Some Rights Reserved.

              

Powered By Z-Blog 1.8 Devo Build 80201