bonjour,
merci Mr votre réponse m'a résolu mon problème voici le code si dessouuuuuuuuus(à la fin de ce message) et dans ma web form d'authentification , j'ai pas d'erreur
et j'ai fait le code suivant (web form authentification)
protectedvoid Page_Load(object sender, EventArgs e)
{
WS_authentification aut = newWS_authentification();
if (Session["UserNum"] != null)
Response.Redirect("reservation1.aspx");
}
protected
void Button1_Click(object sender, EventArgs e)
{
WS_authentification authentification = newWS_authentification();
bool res = authentification.authentifier(login.Text, mp.Text);
if (res == true)
Response.Redirect("reservation1.aspx");
}
=>le résultat si je clique sur le bouton "Button1_Click" il m' affiche la page reservation1.aspx
mon problème si j'ajoute à la page
reservation1.aspx ce code
if (Session["UserNum"] == null)
Response.Redirect("authentification.aspx");
Label1.Text = Session["UserNum"].ToString();
pour entrer à la session. si je clique sur le bouton "Button1_Click" il ne m'affiche pas la page reservation1.aspx et il reste à la page d'authentification
quel est mon erreur??

s'il vous plait aidez moi cé pour mon projet fin d'etude merci de votre colaboration
/////////***********////
[WebMethod(true)]public
bool authentifier(string login, string mp) {
System.Data.SqlClient.
SqlConnection connexion; connexion =
new System.Data.SqlClient.SqlConnection();string
connectString = "Data Source=STANDARD;"+
"Initial Catalog=SejoursHOTEL;"+
"User ID=sa;"+
"Password=administrateur;";string
strQuery = "select * from T_CLIENT"; connexion.ConnectionString = connectString;
System.Data.SqlClient.
SqlCommand oCommand = new System.Data.SqlClient.SqlCommand(strQuery, connexion); connexion.Open();
SqlDataReader
oReader = oCommand.ExecuteReader();int
b = -1;bool
returnBool = false;while
(oReader.Read()) {
if (oReader[8].ToString() == login && oReader[9].ToString() == mp) {
try { Session["user"] = oReader[0].ToString(); returnBool =
true; }
catch (Exception e){returnfalse;} }
}
oReader.Close();
connexion.Close();
return
returnBool; }