Hello, 

         I have a problem using web.config with mono.

         My code in web.config:

         <authentication mode="Forms">

       <forms name="login" loginUrl="Login.aspx" />

       </authentication>

       <authorization>

       <deny users="?"/>

       </authorization>

       I have Login.aspx and WebForm1.aspx page created, my Global.asax.cs file contend the following code:

using System;

using System.Collections;

using System.ComponentModel;

using System.Web;

using System.Web.SessionState;

using System.Security.Principal;

using System.Web.Security;

 

namespace Prueba

{

/// <summary>

/// Summary description for Global.

/// </summary>

public class Global : System.Web.HttpApplication

{

public Global()

{

InitializeComponent();

}

protected void Application_AuthenticateRequest(Object sender, EventArgs e)

{

//Fires upon attempting to authenticate the use

if (!(HttpContext.Current.User == null))

{

if (HttpContext.Current.User.Identity.IsAuthenticated)

{

if (HttpContext.Current.User.Identity.GetType() == typeof(FormsIdentity))

{

FormsIdentity fi = (FormsIdentity) HttpContext.Current.User.Identity;

FormsAuthenticationTicket fat = fi.Ticket;

String[] astrRoles = fat.UserData.Split('|');

HttpContext.Current.User = new GenericPrincipal(fi, astrRoles);

}

}

}

}

protected void Application_Start(Object sender, EventArgs e)

{

}

protected void Session_Start(Object sender, EventArgs e)

{

}

protected void Application_BeginRequest(Object sender, EventArgs e)

{

}

protected void Application_EndRequest(Object sender, EventArgs e)

{

}

 

protected void Application_Error(Object sender, EventArgs e)

{

}

protected void Session_End(Object sender, EventArgs e)

{

}

protected void Application_End(Object sender, EventArgs e)

{

}

#region Web Form Designer generated code

/// <summary>

/// Required method for Designer support - do not modify

/// the contents of this method with the code editor.

/// </summary>

private void InitializeComponent()

{

}

#endregion

}

}

But Does Not Work.
The Login.aspx page can�t view and WebForm1.aspx is acceded directly.

Please Help Me.

Very Thanks.

Mono is a great project.


_______________________________________________ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list

Reply via email to