在 asp.net mvc 中的 Post 操作后保留 jquery 选项卡位置

发布于 2024-08-18 19:13:01 字数 563 浏览 8 评论 0原文

我有一个带有 jquery 选项卡的页面,用户可以在每个选项卡中更新他们的个人资料、密码、常规。

当用户更新“常规”选项卡中的详细信息时,将调用发布操作,并且它应该保留“常规”选项卡。

可以通过调用http://localhost:8742/User/Settings/10#General直接访问它。 url 中的 10 是用户 ID。

如何在我的 asp.net mvc (C#) 应用程序中使用 RedirectToAction 来保留“常规”选项卡。

我尝试过:

return RedirectToAction("Settings#General", new { Id= _user.Id });

但是上面的方法不起作用,因为它有 routeValues 。如何在使用 RedirectToAction 和 routeValues 进行后操作后保留 jquery 选项卡?或者我如何重写上面的 RedirectToAction 来完成此任务?

I have a page with jquery tabs in which the user can update their Profile, Password, General in each tab.

When a user update the details in "General" tab, the post action will be called and it should retain the "General" tab back.

It can be accessed directly by calling like http://localhost:8742/User/Settings/10#General. In the url 10 is the user id.

How can i use the RedirectToAction in my asp.net mvc (C#) application to retain the "General" Tab.

I have tried like:

return RedirectToAction("Settings#General", new { Id= _user.Id });

But the above one doesn't works as it has routeValues in it. How can i retain the jquery tab after post action using RedirectToAction with routeValues ? Or How can i rewrite my above RedirectToAction to accomplish this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

三生殊途 2024-08-25 19:13:01

请参阅此处了解可能的解决方案。

希望这有帮助。

See here for a possible solution.

Hope this helps.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文