jakub 9. 3. 2010 12:13:35 Body: 3625 Najaktívnejší č.: 8 login Problem: prihlasenie sa mam master stranku a tam mam zadavam meno a heslo, pricom toto kontrolujem na tabulku,toto zbehne je ok a dalej kontrolujem meno a heslo na FormsAuthentication.Authenticate(ab, ac) a ked toto zbehne narazi na problem u FormsAuthentication.RedirectFromLoginPage(ab, chkPersistCookie.Checked); je to logicke ,lebo sa prihlasujem zatial bez pristupu na zakladnu stranku, cim mam toto nahradit.public void Login(object sender, System.EventArgs e) ...{ if (Over(txbUser.Text, txbPassword.Text)==true) ...{ string user = txbUser.Text; // string txttconn = System.Configuration.ConfigurationManager.AppSettings["myconnection"]; SqlConnection conn = new SqlConnection(txttconn); conn.Open(); SqlCommand cmd1 = new SqlCommand("select top 1 aktivuj from registracia where (pmeno='" + user + "')", conn); string aktiva = (string)cmd1.ExecuteScalar(); if (aktiva=="Neaktivovany") ...{ Page.ClientScript.RegisterStartupScript(this.GetType(), "40", "alert('Vas ucet este nebol aktivovany pre nakup.');", true); return; } Session.Contents.Remove("Reg"); Session["Reg"]= user;po tialto to mi to zbehne ok Login2("admino", "alkont"); //tu prechadzam na druhu kontrolu mena a hesla }void Login2(string ab, string ac) //partial ...{ if (FormsAuthentication.Authenticate(ab, ac)) ...{ FormsAuthentication.RedirectFromLoginPage(ab, chkPersistCookie.Checked); //tu je problem treba to nahradit } } jakub [Reakcia]
jakub 9. 3. 2010 12:27:13 Body: 3625 Najaktívnejší č.: 8 RE: login uz mi to ide dal som FormsAuthentication.SetAuthCookie(ab, false); jakub [Reakcia]