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

时间:2022-12-01 08:16:34

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

我有一个带有jquery选项卡的页面,用户可以在每个选项卡中更新其配置文件,密码,常规。

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.

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

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

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

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?

但上面的一个不起作用,因为它有routeValues。如何使用带有routeValues的RedirectToAction在post post操作后保留jquery选项卡?或者我如何重写上面的RedirectToAction来实现这一目标?

1 个解决方案

#1


5  

See here for a possible solution.

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

Hope this helps.

希望这可以帮助。

#1


5  

See here for a possible solution.

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

Hope this helps.

希望这可以帮助。