注册 登录
编程论坛 ASP.NET技术论坛

jqmodal代替alert()

huhanlinhhl 发布于 2010-09-05 10:45, 916 次点击
我想通过弹出jqmodal来代替alert()方法 但是在页面执行一次js后 无论怎么点击button js都会执行 不会执行服务器端的判断

代码如下(

1.button 的click事件

        protected void ex3aTrigger_Click(object sender, EventArgs e)
        {
            string s = TextBox1.Text.Trim();
            if (s!="abc")
            {
                dialogTitle.InnerHtml = "登陆失败";
                dialogMessage.InnerHtml = "用户名密码错误";
                Page.ClientScript.RegisterStartupScript(Page.GetType(), "message", "showDialog()", true);
            }
           
        }



2.js代码

function showDialog() {
    $('#ex3a').jqm({
        trigger: '#ex3aTrigger',
        modal: true,
        overlay: 70, /* 0-100 (int) : 0 is off/transparent, 100 is opaque */
        overlayClass: 'whiteOverlay'
    }).jqDrag('.jqDrag'); /* make dialog draggable, assign handle to title */
    // Close Button Highlighting. IE doesn't support :hover. Surprise?
    $('input.jqmdX')
        .hover(
            function() { $(this).addClass('jqmdXFocus'); },
            function() { $(this).removeClass('jqmdXFocus'); })
          .focus(
            function() { this.hideFocus = true; $(this).addClass('jqmdXFocus'); })
         .blur(
            function() { $(this).removeClass('jqmdXFocus'); });
}
0 回复
1