重新获得视图的当前状态 [英] Regain the current state of the view

查看:68
本文介绍了重新获得视图的当前状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨朋友们,



我的要求是,在我们的cshtml页面中我们有一个上传文件进程,为此我们使用Html.Beginform进行特定操作在我们的控制器上传过程之后,我们使用RedirectToAction来查看相同的视图。但是当我们回到视图时,它正在重新加载,以便之前填充的控件数据是空白的。这样我们怎样才能重新获得视图的当前状态因为它不能使用Ajaxbeginform(文件路径是空的)



谢谢,

Soumya

Hi Friends,

My requirement is, In our cshtml page we have one upload file process,For that we are using Html.Beginform for a specific action to the controller.In our controller after upload process we use RedirectToAction to the same view .But when we come back to the view,It is reloading so that the previous filled controls datas are blank.Here how could we regain the current state of the view since it can't use Ajaxbeginform(filepath would be empty)

Thanks,
Soumya

推荐答案

要重新获得视图的当前状态,您应该进行Ajax调用以将表单详细信息保存到服务器以避免页面刷新。如果您要提交表单,则意味着您正在与服务器进行交互

这将导致每次向服务器发送请求时刷新页面。因此,为了避免页面刷新,请进行ajax调用。
To regain the current state of the view you should make an Ajax call to save the form details to server for avoiding page refresh.If you are submitting a form,means you are interacting with server
which will cause page to be refreshed each time you send request to server.So to avoid page refresh make ajax call.


这篇关于重新获得视图的当前状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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