سؤال

I'm trying to set filterContext.Result = new RedirectResult, using T4MVC

My existing call is:

filterContext.Result = new RedirectResult("/account/login?ErrorCode=" + ServiceLocator.ExceptionHelper().NotLoggedInError.Code);

which I want to replace.

Is this possible with T4MVC?

هل كانت مفيدة؟

المحلول

Not sure if it's the best way, but this works:

filterContext.Result = new RedirectResult(Url.Action(MVC.Account.Login(ServiceLocator.ExceptionHelper().NotLoggedInError.Code)));
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top