Last post Apr 29, 2010 06:38 AM by Nai-Dong Jin - MSFT
Apr 26, 2010 11:21 AM|sagngh9|LINK
I am facing one problem when i am using asp.net membership in asp.net mvc.Even though i am getting logged in and able to access the resource my login status remain as log on(instead of logoff).Following is the code snippet for displaying the logon status.
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
Welcome <b><%= Html.Encode(Page.User.Identity.Name) %></b>!
[ <%= Html.ActionLink("LogOff", "LogOff", "Account") %> ]
[ <%= Html.ActionLink("Log On", "LogOn", "Account") %> ]
Worst part is when i am using the authorize filter attribute in controller i am getting a blank page when i enter my credientals and log on.
[Authorize(Roles = "admin")]
public class KeyValueController : Controller
NB:The stuff works fine in local machine but gives the problem on development server.
Role Management Asp.net mvc
Apr 26, 2010 12:43 PM|Knecke|LINK
Are both local machine and development server using the same database? If not, have you set up the same role on the development server database?
Apr 29, 2010 06:38 AM|Nai-Dong Jin - MSFT|LINK
IsAuthenticated property relates to ASP.NET membership while IsAuthorized property relates to role management. Suppose you are using Forms authentication, in your code, I'm not sure if you are using membership to handle the login process or create the login
process manually, if you create it manually, you need to add the authentication ticket. For more info, see: