Intanto grazie per la cortese risposta.
Ora pr quanto riguarda il primo punto ci sono arrivato infatti il web.config dentro l'area riservata che si chiama CARTELLAPROTETTA ha il seguente codice:
codice:
<?xml version="1.0"?>
<configuration>
<system.web>
<authorization>
<deny users="?"/>
</authorization>
</system.web>
<location path="PLUTO">
<system.web>
<authorization>
<allow users="PLUTO"/>
<deny users="*"/>
</authorization>
</system.web>
</location>
</configuration>
Infatti in questo modo solo PLUTO può accedere o vedere la sotto cartella PLUTO
Il problema ora sta nel reindirizzare. Ti allego il file login.aspx.cs dove c'è il reindirizzamento se l'utente ha effettuato il login.
In pratica li dentro dovrei dirgli....se qualsiasi utente redirect to CartellaProtetta/Default.aspx
Se utente PLUTO e solo PLUTO allora vai a CartellaProtetta/PLUTO/default.aspx
codice:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class Login : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void login1_Authenticate(object sender, AuthenticateEventArgs e)
{
if (Membership.ValidateUser(login1.UserName,login1.Password))
{
FormsAuthenticationTicket tkt;
string cookiestr;
HttpCookie ck;
tkt = new FormsAuthenticationTicket(1, login1.UserName, DateTime.Now, DateTime.Now.AddMonths(12), login1.RememberMeSet, "user");
cookiestr = FormsAuthentication.Encrypt(tkt);
ck = new HttpCookie(FormsAuthentication.FormsCookieName, cookiestr);
if (login1.RememberMeSet)
ck.Expires = tkt.Expiration;
ck.Path = FormsAuthentication.FormsCookiePath;
Response.Cookies.Add(ck);
string strRedirect;
strRedirect = Request["ReturnUrl"];
if (strRedirect == null)
strRedirect = "CartellaProtetta/Default.aspx";
Response.Redirect(strRedirect);
}
}
}