客户端js服务端互相调用

<head runat="server">
    <title>无标题页</title>
    <script type="text/javascript">
    //要写在head内

    function ConfirmAddEquipment()
    {
        if(confirm('调用吗?'))

            __doPostBack('CreateDir',   '');

    }  
    </script>   
</head>           

 

 <asp:LinkButton   ID="CreateDir"   runat="server"   OnClick="CreateDir_Click"   />  

           

 

                string s = "<script language=javascript>ConfirmAddEquipment();</script>";
                ClientScriptManager cs = Page.ClientScript;
                Type cstype = this.GetType();
                cs.RegisterStartupScript(cstype, "ConfirmAddEquipment", s);//在</from>前执行

posted on 2008-08-30 15:04  zyi  阅读(226)  评论(0编辑  收藏  举报

导航