我需要在Click事件中执行期间从最终用户那里获得一些确认. [英] i need to get some confirmation from end user during execution in a Click event.

查看:95
本文介绍了我需要在Click事件中执行期间从最终用户那里获得一些确认.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在执行Click事件期间,我需要获得最终用户的确认.并据此决定下一步.但是,单击事件结束后会弹出弹出消息".我如何才能使其停止,直到用户单击某些确认消息上的按钮?? ..


i need to get some confirmation from end user during execution in a Click event. and depending on it my next step will be decided. But the Pop Up message gets poped up after my click event is over. How can i make it stop till user clicks a button on some confirmation message ??..


if (Session["fBudget"] != null && Session["fExceedValue"] != null)
                   {
                       fBudget = Convert.ToInt32(Session["fBudget"]);
                       fExceedValue = Convert.ToInt32(Session["fExceedValue"]);
                       if (fExceedValue < fSumActualLineTotal)
                       {
                           //Open pop up to show details.
                          // NEED POP UP HERE AND GET DECISION FROM USER??
                          // DEPENDING ON USER "OK" return TRUE
                          // and "CANCEL" return FALSE 
                       }
                       else
                       {
                           return true;
                       }
                   }

推荐答案



根据您的要求.如果要等待用户确认,仅是第二个请求.不能停止请求处理并将两个请求绑定在单个进程中.

我的建议是使用jquery,它可以帮助您解决任何问题.让我告诉您问题的过程.如果要确认,请首先使用jquery get方法获取会话变量或在服务器端检查会话变量,然后再向浏览器发送异步响应,由jquery处理.

如果用户单击确定,则jQuery响应方法将弹出到user.thn
再次向服务器发送异步请求以继续进行处理.


希望你能理解我的意思.

进入Jquery.

最好的
Hi,

According to your requirement.If you want to wait for confirmation of user it is nothing but second request.you cannot halt request processing and binding two requests in single process.

My advice is use jquery it can helps you any situation .Let me tell you the process for your problem .first use jquery get method to get your session variables or check session variables in server side if you want confirmation thn send asynchronous response to browser which is handled by jquery.

Jquery response method show popup to user.thn if user click on ok
again send asynchronous request to server to continue you process.


I hope you understand what I said.

Step into Jquery.

All the best


如果您的页面中没有使用脚本管理器,请在if条件中写此行.
if you are not using script manager in your page then write this line inside if condition..the place where u commented above

Page.RegisterStartupScript("a", "<script language=''javascript''>window.confirm(''your message'');</script>");




希望对您有帮助

如果不起作用,请回复我




hope it helps you

reply me if not works


没有,实际上我需要返回值..
是真的还是假取决于我,下一步决定了...
实际尝试过这种方法,但单击事件完成后会弹出对话框
no actually i need return value..
true or false depending on it my next step is decided...
actually tried this approach but pop up is seen after completion of click event


这篇关于我需要在Click事件中执行期间从最终用户那里获得一些确认.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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