Hello,
i have a Log on in APS MVC 2.0 and if not logged on, i want to redirect the user to that page.
i found the way to do it is usin the RedirectAction (found several times on google, even on stack Overflow)
<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<h2><%: ViewData["Message"] %></h2>
<p>
<% if (Request.IsAuthenticated) { %>
Go to this page <%: Html.ActionLink("Manage Payment Run", "ManagePaymentRun")%>
<%} else { %>
<% return RedirectToAction("LogOn", "Account"); %>
<% } %>
</p>
</asp:Content>
Now, the problem is that i get "The name RedirectToAction does not exist in the current context". I was wondering if anyone here knows why this happens, since my googling skill didnt even get close to finding anyone with a similar problem.
Thanks for your time.