如何在单击提交按钮后禁用页面并处理该按钮的继续 [英] how to disable a page after submit button click and also process continue of that button

查看:96
本文介绍了如何在单击提交按钮后禁用页面并处理该按钮的继续的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的所有人,

我想在提交按钮"的过程中将整个页面禁用一段时间...

我在提交"按钮上使用了一个Javascript确认功能.

因此,我想在单击提交"按钮时执行它,并禁用页面或显示整个页面的某些过程.


因此,如何使用按钮代码禁用整个页面?

请帮我...


谢谢和问候...
Mitesh

Dear All,

I want to make the Whole page disable for some time during the process of Submit Button...

I use one Javascript confirm function on Submit button.

so, i want to make when Submit button click it execute it code and also page disable or want to show some process of whole page.


so, how can i make whole page disable with the button code?

please help me...


Thanks and Regards...
Mitesh

推荐答案

老兄,
我认为您的问题与禁用ASP.NET按钮非常相似使用AJAX加载背景图片进行回发期间的控制 [ ^ ].

您需要添加一个函数,该函数将根据传入的参数来禁用和启用所有(所需的)控件.现在,在按钮onclick javascript event中的函数中调用该函数.按钮aspx代码将如下所示:
Hi Mits,
I think your question is very similar to Disabling an ASP.NET Button Control During Postback with an AJAX Loading Background Image[^].

You need to add a function which will disable and enable all the controls(which you need) based on the parameter passed in it. Now call the function in the function in button onclick javascript event. Button aspx code will be like this:
<asp:button id="btn" runat="server" onclientclick="fnDisable('true')" onclick="btn_Click" xmlns:asp="#unknown" />


完成所有操作后,从页面源调用同一事件.试试这个:


After doing all the stuffs call the same event from page source. Try this:

protected void btn_Click(object sender, EventArgs e){
     //Do your all process.
     ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "Enable", "fnDisable('false');", true);
}




希望对您有帮助!
  -授予




Hope it helps!
  --Amit


单击按钮时,触发JavaScript代码(将在服务器单击代码之前执行).在此JS代码中,根据需要在整个页面或指定区域上放置一个div(Z索引较高).稍后,服务器进程完成后,您可以再次隐藏div.

只要执行按钮单击过程,整个过程都会使页面感觉被禁用.
On button click, trigger a JavaScript code (which will be executed before server click code). In this JS code, place a div (with a higher z-index) over the whole page or specified area as per need. Later, once the server process is complete, you can hide div again.

This whole process would give a feel of disabled page as long the button click process was executing.


这篇关于如何在单击提交按钮后禁用页面并处理该按钮的继续的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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