使用C#在ASP.Net中不刷新如何设置页面 [英] How to set Page are not refresh in ASP.Net with C#

查看:375
本文介绍了使用C#在ASP.Net中不刷新如何设置页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用C#在ASP.Net中开发在线考试项目。



但问题是:当使用刷新页面时,考试重启..但是我希望当用户在一次用户不能刷新页面时给予考试。



提前谢谢...

I am developing the Online Exam project in ASP.Net with C#.

but problem is : when use are refresh the page, then exam are restart... but i want when user are give exam at a time user can not allow to refresh the page.

thank you in advance...

推荐答案

将数据存储在xml文件或数据库中,无论您喜欢什么。您可以在刷新时重新填充字段。

还会显示警告,说明如果用户刷新页面会发生什么。

也许可以使用javascript完成但我可以不要认为你应该尝试覆盖客户端的浏览器功能。
Store the data in an xml file or database, whatever you are comfortable with. You can re populate the fields on refresh.
Also display a warning saying that what will happen if the user refreshes the page.
Maybe it can be done using javascript but I don't think you should try to overrride the client's browser funtionalities.


如果你对JQuery感到满意,那么在后台你可以将客户端数据发送到服务器以维护数据库/会话中的客户端状态。如果客户端刷新浏览器,您可以从保存在数据库/会话中的最后一个状态恢复他。对于webmethod演示,您可以参考以下链接

调用ASP .Net WebMethods使用jQuery [ ^ ]和

http: //aspsnippets.com/Articles/Calling-ASPNet-WebMethod-using-jQuery-AJAX.aspx [ ^ ]
If you are comfortable with JQuery then at background you can send client data to server to maintain state of client in database/session. If client refreshes browser you can resume him from that last state saved in database/session. For webmethod demo you can refer following links
Calling ASP.Net WebMethods using jQuery[^] and
http://aspsnippets.com/Articles/Calling-ASPNet-WebMethod-using-jQuery-AJAX.aspx[^]


这篇关于使用C#在ASP.Net中不刷新如何设置页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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