mvc和后退按钮
我是 mvc 新手,所以我不知道这是否有技巧。当用户在我正在构建的网站上运行搜索并将其带到结果页面时,如果单击后退按钮,搜索表单将为空。有没有什么方法可以让表单字段保持返回时的状态(不诉诸会话)?谢谢。
I'm new to mvc so I don't know if there is a trick to this or not. When a user runs a search on a site I'm building and I take them to the results page, if I click the back button the search form is empty. Is there some way to keep the form fields populated as they were when going back (without resorting to session)? Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
奇怪。
默认情况下应该存在字段。您使用什么浏览器?
如果您使用的是常规浏览器,那么您可能会做一些奇怪的事情,例如通过 JavaScript 或其他方式重置字段。也许详细说明您当前的实施将有助于诊断您的问题?
最后一个解决方案是将字段保存为 cookie,并通过 onLoad 内的表单页面上的 JavaScript 加载它们。
Strange.
Fields should be there by default. What browser are you using?
If you're using a regular browser, then maybe your doing something weird, like, resetting the fields via JavaScript or something. Perhaps elaborating more on your current implementation would help diagnosing your problem?
A last solution would be saving the fields as a cookie and loading them via JavaScript on the forms page inside onLoad.