Tutorials
ASP.NET
Securing ASP.NET Applications with C#
Securing ASP.NET Applications with C# - Page 2
Securing ASP.NET Applications with C# - Page 3
FormsAuthentication.SignOut();
Don't leave all the things for your business logic and then for the database to decide. Do all the validation before you send the data to the business layers and the database layers. For this you can always use RequiredFieldValidators to check that if the required fields are not left blank. Client side Validation
I hope you enjoyed the tutorial happy programming !
Response.Cookies["UserName"].Value = null;
// The date can be anything which has already passed
Response.Cookies["UserName"].Expires = new System.DateTime(1999,10,12);
Response.Redirect("Whateverpage.aspx");
As you can see the code above is pretty simple and straight forward. The FormsAuthentication class provides a signout method which can be used to signout users.
Later we assign null to the cookie and expired the cookies date by assigning it a date which has already passed. After signout the user I simply redirected the user to another page.
{
FormsAuthentication.RedirectFromLoginPage(txtUserName.Text,false);
By default it is set to the Windows authentication mode in order to change this to forms authentication you will just need to change the windows to forms as I have shown below:
Okay so now you have set your application to use the features of the forms authentication instead of the windows authentication.
First Page: Securing ASP.NET Applications with C#
| Hi all, I\'m new here. Hope to ctach up with the project work. |
| Its was very simple and really good! |
| I think this tutorial is very helpful for the begginers, and you can easily know the basic of .Net here.. Really cool |
|
i dont know how to get custom authentication coding out plz if u know than help me out |
|
i had tried to do forms authentication for number of users but how to do with this can u give me some idea thanks in advance |
|
tried to do forms authentication for number of users but how to do with this can u give me some idea |