即兴与ASP.NET [英] impromptu with ASP.NET

查看:55
本文介绍了即兴与ASP.NET的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在ASP.NET应用程序中使用即兴.我在特伦特(Trent)的网站以及亚伦(Aaron)的网站上浏览了一些示例.我正在使用jquery 1.3.2和impromptu 4.0(也尝试过2.7,这是Aaron的示例所基于的).

在下面的代码中,即兴提示显示确认,但是它不会等待"用户的回答,而是即使在显示即兴提示时也执行后面的代码.也就是说,提示起着无模式对话框的作用,但是我需要模式对话框.

我是否缺少使提示变为模态的内容?如果我将.prompt替换为基本的JavaScript确认",则其行为符合预期.

javascript:

I''m trying to use impromptu in my ASP.NET app. I''ve dug through examples on Trent''s site as well as Aaron''s site. I''m using jquery 1.3.2 and impromptu 4.0 (also tried 2.7, which is what Aaron''s examples are built on).

In the code below, the impromptu prompt displays the confirmation, but it does not "wait" for an answer from the user, instead the code-behind is executed even while the impromptu prompt is being displayed. That is, the prompt is acting as a modeless dialog but I need it modal.

Am I missing something to cause the prompt to be modal? If I replace the .prompt with a basic javascript "confirm" it behaves as expect.

javascript:

function removeUser(){
	var txt = 'Are you sure you want to remove this user?';
	
	$.prompt(txt, {
	    buttons:{Delete:true, Cancel:false},
	    callback: function(e,v,m,f){ return v; }
	});
}



VB Button(实际上位于ListView中,但是我怀疑那不会有所作为):



VB Button (which actually resides in a ListView, but I suspect that wouldn''t make a difference):

<asp:ImageButton ID="btnSignoffDelete" runat="server" ImageUrl="~/Images/icon_delete.png" CommandName="Delete" CausesValidation="false" OnClientClick="return removeUser();" />



同样,出于测试目的,它可以按预期工作:



Again, for testing purposes, this works as expected:

function removeUser(){
    var txt = 'Are you sure you want to remove this user?'

    return confirm(txt);
}

推荐答案

.prompt(txt,{ 按钮:{删除:,取消: false }, 回调:函数(e,v,m,f){返回 v; } }); }
.prompt(txt, { buttons:{Delete:true, Cancel:false}, callback: function(e,v,m,f){ return v; } }); }



VB Button(实际上位于ListView中,但是我怀疑那不会有所作为):



VB Button (which actually resides in a ListView, but I suspect that wouldn''t make a difference):

<asp:ImageButton ID="btnSignoffDelete" runat="server" ImageUrl="~/Images/icon_delete.png" CommandName="Delete" CausesValidation="false" OnClientClick="return removeUser();" />



同样,出于测试目的,它可以按预期工作:



Again, for testing purposes, this works as expected:

function removeUser(){
    var txt = 'Are you sure you want to remove this user?'

    return confirm(txt);
}


这篇关于即兴与ASP.NET的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆