如何在asp.net中处理保存情况? [英] How to handle save situations in asp.net?

查看:80
本文介绍了如何在asp.net中处理保存情况?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我有一个允许用户输入数据的网站。完成数据输入后,可以单击按钮保存输入。现在的问题是,我没有可能想象页面正在被保存以及什么时候(希望)保存完毕。

我想到一个模态窗口在他们点击保存时使用JavaScript打开按钮告诉他们数据正在保存。保存完成后我可以使用?? Page.RegisterClientScriptBlocka ??执行关闭模态窗口的客户端脚本。虽然我可以想象的一个问题是当我想关闭它时如何识别模态窗口(使用?? Page.RegisterClientScriptBlocka ??)以及如果用户使用?? Xa ??关闭此窗口该怎么办。在JavaScript中是否有任何方法可以测试窗口是否仍然可用?


有人知道一些最佳实践吗?关于如何处理这种情况?谢谢!


Daniel

Hi,

I have a Website which allows users to input data. After they finished entering data they can click a button to save their input. Problem now is, that I have no possibility to visualize that the page is being saved and when it is (hopefully) done saving.
I thought about a modal window being opened using JavaScript when they click the save button telling them that the data is being saved. After saving is completed I could use a??Page.RegisterClientScriptBlocka?? to execute a client script closing the modal window. One problem though I could imagine is how to identify the modal window when I want to close it (using a??Page.RegisterClientScriptBlocka??) and what to do if the users close this window using a??Xa??. Is there any way in JavaScript to be able to test whether the window is still available?

Does anybody know some a??best practicesa?? on how to handle this situation? Thank you!

Daniel

推荐答案

我认为你想在用户之间放一些东西点击

保存按钮和新页面显示。


我倾向于使用DHTML更新现有页面而不是

试图弹出一个新窗口。


一旦用户点击按钮,就可以使用document.write()来重写页面

说''保存更改''或使用''div''标签来发消息

出现。然后张贴表格


" Daniel Walzenbach" <哒********************** @ freudenberg.de>写在

消息新闻:D4 ********************************** @ microsof t.com ...
I presume you want to put something on the screen between the user clicking
the save button and the new page displaying.

I would be inclined to use DHTML to update the existing page rather than
trying to pop up a new window.

As soon as the user clicks the button, either use document.write() to
rewrite the page to say ''saving changes'' or use ''div'' tags to make a message
appear. then post the form

"Daniel Walzenbach" <da**********************@freudenberg.de> wrote in
message news:D4**********************************@microsof t.com...


我有一个允许用户输入数据的网站。完成
输入数据后,他们可以点击按钮保存输入。现在的问题是,

,我无法想象页面正在被保存,并且当它(希望)完成保存时可以获得
。我想到了一个使用JavaScript打开的模态窗口,当他们
点击保存按钮告诉他们数据正在保存时。

保存完成后,我可以使用Page.RegisterClientScriptBlock。执行

关闭模态窗口的客户端脚本。虽然我可以想象一个问题

是当我想关闭它时如何识别模态窗口(使用

" Page.RegisterClientScriptBlock")以及如果用户使用X关闭此

窗口。 JavaScript中是否有任何方法可以测试窗口是否仍然可用?
是否有人知道某些最佳实践?关于如何处理这种情况?
谢谢!
Daniel
Hi,

I have a Website which allows users to input data. After they finished entering data they can click a button to save their input. Problem now is,
that I have no possibility to visualize that the page is being saved and
when it is (hopefully) done saving. I thought about a modal window being opened using JavaScript when they click the save button telling them that the data is being saved. After
saving is completed I could use "Page.RegisterClientScriptBlock" to execute
a client script closing the modal window. One problem though I could imagine
is how to identify the modal window when I want to close it (using
"Page.RegisterClientScriptBlock") and what to do if the users close this
window using "X". Is there any way in JavaScript to be able to test whether
the window is still available?
Does anybody know some "best practices" on how to handle this situation? Thank you!
Daniel



你不能在Web应用程序中真正做模态对话框。 AFAIK没有

方式阻止用户点击后面的窗口


如果你使用div方法你可以让按钮隐藏在

发布表格会阻止用户点击两次。


当然,用户仍然可以使用control-n或shift-click来获得2
windows在同一页面打开,然后他可以点击两者中的保存。


Daniel Walzenbach <哒********************** @ freudenberg.de>写在

消息新闻:D0 ********************************** @ microsof t.com ...
you can''t really do modal dialogs in a web application. AFAIK there is no
way to stop the user clicking on the window behind

if you use the div approach you can make the buttons invisible just before
posting the form which will stop the user clicking twice.

of course, the user could still use control-n or shift-click to get 2
windows open on the same page, then he could click save in both.

"Daniel Walzenbach" <da**********************@freudenberg.de> wrote in
message news:D0**********************************@microsof t.com...
Andy,

感谢您的回答。打开模态对话框的原因是
我想阻止用户多次单击保存按钮。一个

的想法可能是禁用客户端上的按钮并在页面回发后再次启用它b / b $ b。虽然这可能还不错,但我还是有兴趣知道是否有人知道如何处理模态

窗口。
Daniel

Andy Fish写道:
Andy,

Thank you for your answer. The reason for opening a modal dialog was that I want to prevent users from clicking the save button multiple times. One
idea though might be to disable the button on the client and enabling it
again after the page was posted back. Though this might be good enough I
still would be interested to know if somebody knows how to handle a modal
window.
Daniel
"Andy Fish" wrote:
我想你想在用户
点击保存按钮和显示新页面之间的屏幕上放一些东西。

我会倾向于使用DHTML来更新现有页面,而不是试图弹出一个新窗口。

一旦用户点击按钮,就可以使用document.write()来
重写页面说''保存更改''或使用''div''标签来显示
消息。然后发表表格

Daniel Walzenbach <哒********************** @ freudenberg.de>在消息新闻中写道:D4 ********************************** @ microsof t.com。 ..
I presume you want to put something on the screen between the user clicking the save button and the new page displaying.

I would be inclined to use DHTML to update the existing page rather than
trying to pop up a new window.

As soon as the user clicks the button, either use document.write() to
rewrite the page to say ''saving changes'' or use ''div'' tags to make a message appear. then post the form

"Daniel Walzenbach" <da**********************@freudenberg.de> wrote in
message news:D4**********************************@microsof t.com...


我有一个允许用户输入数据的网站。完成
Hi,

I have a Website which allows users to input data. After they finished


输入数据后,可以单击按钮保存输入。问题现在
是,我没有可能想象页面正在被保存和
什么时候(希望)保存。


entering data they can click a button to save their input. Problem now is, that I have no possibility to visualize that the page is being saved and
when it is (hopefully) done saving.

我想到了一个模态窗口正在
I thought about a modal window being opened using JavaScript when they

时使用JavaScript打开
单击保存按钮,告诉他们正在保存数据。
保存完成后,我可以使用Page.RegisterClientScriptBlock。到
执行关闭模态窗口的客户端脚本。虽然我可以设想一个问题是
想象的是当我想关闭它时如何识别模态窗口(使用
Page.RegisterClientScriptBlock)以及如果用户关闭此窗口该怎么办?使用X。在JavaScript中是否有任何方法可以测试
窗口是否仍然可用?


click the save button telling them that the data is being saved. After
saving is completed I could use "Page.RegisterClientScriptBlock" to execute a client script closing the modal window. One problem though I could imagine is how to identify the modal window when I want to close it (using
"Page.RegisterClientScriptBlock") and what to do if the users close this
window using "X". Is there any way in JavaScript to be able to test whether the window is still available?


是否有人知道某些最佳实践?关于如何处理这个

Does anybody know some "best practices" on how to handle this


的情况?谢谢!

situation? Thank you!


Daniel

Daniel




这是一个免费控制只允许1次点击:
http:// www。 metabuilders.com/Tools/OneClick.aspx

-

Joe Fallon

" Daniel Walzenbach" <哒********************** @ freudenberg.de>写在

消息新闻:D0 ********************************** @ microsof t.com ...
This is a free control which only allows 1 click:
http://www.metabuilders.com/Tools/OneClick.aspx
--
Joe Fallon
"Daniel Walzenbach" <da**********************@freudenberg.de> wrote in
message news:D0**********************************@microsof t.com...
Andy,

感谢您的回答。打开模态对话框的原因是
我想阻止用户多次单击保存按钮。一个

的想法可能是禁用客户端上的按钮并在页面回发后再次启用它b / b $ b。虽然这可能还不错,但我还是有兴趣知道是否有人知道如何处理模态

窗口。
Daniel

Andy Fish写道:
Andy,

Thank you for your answer. The reason for opening a modal dialog was that I want to prevent users from clicking the save button multiple times. One
idea though might be to disable the button on the client and enabling it
again after the page was posted back. Though this might be good enough I
still would be interested to know if somebody knows how to handle a modal
window.
Daniel
"Andy Fish" wrote:
我想你想在用户
点击保存按钮和显示新页面之间的屏幕上放一些东西。

我会倾向于使用DHTML来更新现有页面,而不是试图弹出一个新窗口。

一旦用户点击按钮,就可以使用document.write()来
重写页面说''保存更改''或使用''div''标签来显示
消息。然后发表表格

Daniel Walzenbach <哒********************** @ freudenberg.de>在消息新闻中写道:D4 ********************************** @ microsof t.com。 ..
I presume you want to put something on the screen between the user clicking the save button and the new page displaying.

I would be inclined to use DHTML to update the existing page rather than
trying to pop up a new window.

As soon as the user clicks the button, either use document.write() to
rewrite the page to say ''saving changes'' or use ''div'' tags to make a message appear. then post the form

"Daniel Walzenbach" <da**********************@freudenberg.de> wrote in
message news:D4**********************************@microsof t.com...


我有一个允许用户输入数据的网站。完成
Hi,

I have a Website which allows users to input data. After they finished


输入数据后,可以单击按钮保存输入。问题现在
是,我没有可能想象页面正在被保存和
什么时候(希望)保存。


entering data they can click a button to save their input. Problem now is, that I have no possibility to visualize that the page is being saved and
when it is (hopefully) done saving.

我想到了一个模态窗口正在
I thought about a modal window being opened using JavaScript when they

时使用JavaScript打开
单击保存按钮,告诉他们正在保存数据。
保存完成后,我可以使用Page.RegisterClientScriptBlock。到
执行关闭模态窗口的客户端脚本。虽然我可以设想一个问题是
想象的是当我想关闭它时如何识别模态窗口(使用
Page.RegisterClientScriptBlock)以及如果用户关闭此窗口该怎么办?使用X。在JavaScript中是否有任何方法可以测试
窗口是否仍然可用?


click the save button telling them that the data is being saved. After
saving is completed I could use "Page.RegisterClientScriptBlock" to execute a client script closing the modal window. One problem though I could imagine is how to identify the modal window when I want to close it (using
"Page.RegisterClientScriptBlock") and what to do if the users close this
window using "X". Is there any way in JavaScript to be able to test whether the window is still available?


是否有人知道某些最佳实践?关于如何处理这个

Does anybody know some "best practices" on how to handle this


的情况?谢谢!

situation? Thank you!


Daniel

Daniel




这篇关于如何在asp.net中处理保存情况?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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