Barre horizontale de naviagtion

vendredi 6 mai 2011

session Mode SqlServer

la classe ClsNiveauConfidentialite il faut la rendre serializable parce quel est enregistré dans la session

tout objet enregistré dans la session doit être sérializable et peut etré c'est la source du problème de sauvgarde de session

[Serializable]

public class ClsNiveauConfidentialite

{

}

si non c'est marche pas pour la persistance on va utiliser le sauvegarde session coté sql server c'est la session http Persistante.
pour cela dans le webconfig mettre ces lignes

<sessionState

mode="SQLServer"

cookieless="false"

sqlConnectionString="Data Source=TAOUFIK-B1C5832\SQLEXPRESS;INTEGRATED SECURITY=SSPI"

timeout="360"

/>

fichier Global.asax

void Session_End(object sender, EventArgs e)

{

Response.Redirect("~/Default.aspx");

}

aller à ce dossier " C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727 "

exécuté le script : InstallSqlState.sql


Application AuthenticateRequest


protected void Application_AuthenticateRequest(Object sender,EventArgs e) {
// Extract the forms authentication cookie
string cookieName = FormsAuthentication.FormsCookieName;
HttpCookie authCookie = Context.Request.Cookies[cookieName];
if(null == authCookie) {
// There is no authentication cookie.
return;
}
FormsAuthenticationTicket authTicket = null;
try {
authTicket = FormsAuthentication.Decrypt(authCookie.Value);
} catch(Exception ex) {
// Log exception details (omitted for simplicity)
return;
}
if (null == authTicket) {
// Cookie failed to decrypt.
return;
}
// When the ticket was created, the UserData property wasassigned
// a pipe delimited string of role names.
// Create an Identity object
FormsIdentity id = new FormsIdentity( authTicket );
string[] Roles =new string[2];
Roles[0]="User";
// This principal will flow throughout the request.
System.Security.Principal.GenericPrincipal principal = new System.Security.Principal.GenericPrincipal(id,Roles);
// Attach the new principal object to the current HttpContextobject
System.Web.HttpContext.Current.User = principal;
}

lundi 2 mai 2011

Ajax Help

Css Style

.help {
visibility:hidden;
display:none;
position:absolute;
width:250px;
background-color:#FFFF99;
border-left:2px outset white;
border-top:2px outset white;
border-right:2px outset #ACA899;
border-bottom:2px outset #ACA899;
left:0px;
top:0px;
z-index:100;
padding: 5px;
padding-top:20px;
font-size :xx-small;
float:right ;
min-width:250px;
}


asp.net code




Séparez les critères de recherche par des ';'
>Exemple:Test1;Test2;Test3