I showing u the url in browser
Before clicking on Button Login
http://localhost:1567/WebSite3/Login.aspx
After clicking on Button Login
http://localhost:1567/WebSite3/Login.aspx?ReturnUrl=%2fWebSite3%2fDefault.aspx
I am Showing a code here From web. config file
and code of Login.aspc.cs
protected void btnLogin_Click(object sender, EventArgs e)
{
//if (FormsAuthentication.Authenticate(RadTextBox1.Text.Trim(), RadTextBox2.Text.Trim()))
//{
string sHashedPass = FormsAuthentication.HashPasswordForStoringInConfigFile(RadTextBox2.Text.Trim(), "SHA1");
string sqlStmt = "Select UserName From UserMaster where UserName='"+RadTextBox1.Text.Trim()+"'and Password='"+RadTextBox2.Text.Trim()+"'";
SqlConnection con = new SqlConnection("Data Source=ISMART-01;Initial Catalog=SMS;Persist Security Info=True;User ID=sa;Password=root");
SqlCommand cmd = new SqlCommand(sqlStmt,con);
//con.Open();
cmd.Connection.Open();
SqlDataReader dr = cmd.ExecuteReader();
//SqlDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection);
while (dr.Read())
{
Session["User"] = RadTextBox1.Text.Trim();
Response.Redirect("Default.aspx");
}
con.Close();
//}
}
Yatish BhavsarPosted Feb 3, 2010, 2:42 AM
But send me some clear code detailed code if u can then palease.
Thanks
Lalit MPosted Feb 3, 2010, 1:13 AM
http://aspalliance.com/684_Codesnip_Redirecting_a_User_to_a_Specific_Page_with_Forms_Authentication
http://msdn.microsoft.com/en-us/library/aa480476.aspx