English 中文(简体)
ASP.net MVC3在用户从现场航行时避免了最后行动,在用户返回后又转向这一行动。
原标题:ASP.net MVC3 save last action when user navigates from site, redirect to that action when they return

基本上,我有一个网站,利用Windows LiveLink进行认证。 当用户选择从主意上签字时,他们被转往显然是在其他地方主办的WL标志。 他们一旦成功签署,就被转往我的网站上的“信号In”行动,如果这是第一次访问,就会增加我数据库的用户,确定会议变量等。

然而,现在的问题是,我总是有“签字”行动把“再行动”退回到主要主页。 这可能是为了用户所欲知,因为他们现在必须回去看他们需要签字的任何页。

My first thought was to add the following to my important actions to save the user s current place:

Session["LastPage"] = RedirectToAction("Index", "Home");

在我签署行动结束时,我试图包括:

if (Session["LastPage"] != null)
    return (ActionResult)Session["LastPage"];
else
    return RedirectToAction("MyPage", "User");

This doesn t actually work though, since apparently my session is getting restarted every time the user navigates away from and back to the site.

我对待这一问题的正确方式? 如果是的话,我如何使本届会议不忘? 如果我完全以错误的方式来这样做,那么有人会向我指出正确的方向?

问题回答

You can give a extra query string with your redirect link to the live authentication site.

仅添加这一论点:

<>>&redirect_uri=YOURURL

您可带上Request.UrlReferer





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签