Server Error in '/' Application.
-------- using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.Security; namespace WebApplication9 { public partial class WebForm1 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void Button1_Click(object sender, EventArgs e) { if (FormsAuthentication.Authenticate(txtUsername.Text, txtPassword.Text)) { lblStatus.Text = ("Welcome " + txtUsername.Text); FormsAuthentication.RedirectFromLoginPage(txtUsername.Text, true); } else { lblStatus.Text = "Invalid login!"; } } } } ----------------- form <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> Username: <asp:TextBox ID="txtUsername" runat="server" /><br> Password: <asp:TextBox ID="txtPassword" runat="server" /><br> <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Login" /><br> <asp:Label ID="lblStatus" runat="server" Text="Please login"> </form> </body> </html> ------------ webconfig <!-- For more information on how to configure your ASP.NET application, please visit http://go.microsoft.com/fwlink/?LinkId=169433 --> <forms name="TestAuthCookie" loginUrl="~/WebForm1.aspx" timeout="30"> </forms> <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)