使用JQ!
能简单说说怎么实现看下JQ文档,很容易的,就算是DIV 也可以给他们绑定点击事件!!!

解决方案 »

  1.   

    把sus的特效属性给asp:Button ID="btnSub"        
      

  2.   


    使用JQ!
    能简单说说怎么实现看下JQ文档,很容易的,就算是DIV 也可以给他们绑定点击事件!!!我试了一下这样写Response.Write("<script>function(){$(\"#sus\").trigger(\"click\")};</script>");点击按钮之后页面排版就乱了
      

  3.   


    使用JQ!
    能简单说说怎么实现看下JQ文档,很容易的,就算是DIV 也可以给他们绑定点击事件!!!我试了一下这样写Response.Write("<script>function(){$(\"#sus\").trigger(\"click\")};</script>");点击按钮之后页面排版就乱了那你可以用这个ClientScript.RegisterClientScriptBlock
      

  4.   


    使用JQ!
    能简单说说怎么实现看下JQ文档,很容易的,就算是DIV 也可以给他们绑定点击事件!!!我试了一下这样写Response.Write("<script>function(){$(\"#sus\").trigger(\"click\")};</script>");点击按钮之后页面排版就乱了那你可以用这个ClientScript.RegisterClientScriptBlockPage.ClientScript.RegisterClientScriptBlock(this.GetType(), "a", "<script>function(){$(\"#sus\").trigger(\"click\")};</script>");改成这样点击之后还是没有点击<button id="sus" class="btn btn-primary noty" data-noty-options='{"text":"密码修改成功","layout":"top","type":"information"}'><i class="icon-bell icon-white"></i> Top Full Width</button>这个时候的效果
      

  5.   

    也可以直接調用JS文件中的方法的funClick()
    Page.ClientScript.RegisterStartupScript(this.GetType(), "back", "funClick()", true);
      

  6.   

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
      
       <script>
           function funClick() {
               alert(1);
               document.getElementById("sus").onclick();
           }   </script>
    </head>
    <body>
        <form id="form1" runat="server">
        <asp:Button ID="btnSub" runat="server" Text="提    交"  class="btn btn-danger" 
            data-rel="popover" data-content="点击修改密码" title="修改密码" onclick="btnSub_Click" />
        <button id="sus" class="btn btn-primary noty" onclick="javascript:alert('ok');" data-noty-options='{"text":"密码修改成功","layout":"top","type":"information"}'><i class="icon-bell icon-white"></i> Top Full Width</button>
        </form>
    </body>
    </html>
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;namespace WebApplication1
    {
        public partial class WebForm20 : System.Web.UI.Page
        {
            protected void Page_Load(object sender, EventArgs e)
            {        }        protected void btnSub_Click(object sender, EventArgs e)
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "back", "funClick()", true); 
            }      
        }
    }
      

  7.   

    或者前台js不写,后台直接
           Page.ClientScript.RegisterStartupScript(this.GetType(), "back", "document.getElementById('sus').onclick()", true); 
      

  8.   

    btn.Attributes.Add("onclick", "opendialog()");去掉
    ClientScript.RegisterStartupScript(this.GetType(), "aa", "opendialog()", true); 直接document.getElemen...肯定有问题; 页面view写js方法:
    function opendialog()
    {}
      

  9.   

    后台写
    ClientScript.RegisterStartupScript(this.GetType(), "aa", "前台javascript方法", true)
      

  10.   

    这个我试过了,运行了运行不了不可能“Microsoft JScript 运行时错误: 无法获取属性“click”的值: 对象为 null 或未定义” 报这个错误,那个提示的按钮是没有onclick事件的,只是点击之后有一个提示的特效,我就想模拟那个按钮被点击了,显示那个提示特效
      

  11.   

    不行,也是报“Microsoft JScript 运行时错误: 无法获取属性“click”的值: 对象为 null 或未定义”的错 ID为sus的按钮时没有onclick的事件的只是点击的时候有这个效果