| | |
Login page help
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: May 2006
Posts: 4
Reputation:
Solved Threads: 0
Hi,
I need some help for my project. I had finished up my login page and I can be logined.
The problem is that I want to allow new users to register themsevles before they can login but I have used various way I can't be directed to the Register.aspx because web.config. Is there anyway to redirect?
I had attached the following codes:
Web.config:
Login.aspx
http://img.photobucket.com/albums/v7...rush/Login.jpg --print sceen of my login.aspx
I need some help for my project. I had finished up my login page and I can be logined.
The problem is that I want to allow new users to register themsevles before they can login but I have used various way I can't be directed to the Register.aspx because web.config. Is there anyway to redirect?
I had attached the following codes:
Web.config:
C# Syntax (Toggle Plain Text)
<configuration> <appSettings> <add key="localhost.DisplayString" value="http://localhost:1032/Webservices1/Service.asmx"/> </appSettings> <system.web> <authentication mode="Forms"> <forms name=".IT3732Login" loginUrl="Login.aspx" protection="All" timeout="60"/> </authentication> <machineKey validationKey="AutoGenerate" decryptionKey="AutoGenerate" validation="SHA1"/> <authorization> <deny users="?"/> </authorization> <compilation debug="true"/> </system.web> </configuration>
Login.aspx
C# Syntax (Toggle Plain Text)
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Login.aspx.cs" Inherits="Login" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script Language="c#" runat="server"> private void CheckLogin(object sender, EventArgs e) { localhost.Service ds = new localhost.Service(); if (ds.Check(TextBox2.Text, txtPassword.Text) == "OK") { FormsAuthentication.RedirectFromLoginPage(TextBox2.Text, false); string Usname = (string)Session["Username"]; Usname = TextBox2.Text; Session["Username"] = Usname; } else { lblMSG.Text = "Login Fail. Please try again."; TextBox2.Text = ""; txtPassword.Text = ""; TextBox2.Focus(); } } </script> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>Coca-Cola - Login</title> </head> <body bgcolor="#cc0000"> <form id="form1" runat="server"> <div style="text-align: center"> <span style="font-size: 16pt; color: white">= = = = = = = = = = = = = = = = = =<br /> = = =The Coca-Cola Company = = =<br /> = = = = = = = = = = = = = = = = = =</span><br /> <br /> <span style="color: white; font-size: 14pt;">= = = = = = =<br /> -- LOGIN --<br /> = = = = = = =</span><br /> </div> User ID: <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox> <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TextBox2" ErrorMessage="User ID is required" ForeColor="White"></asp:RequiredFieldValidator><br /> <br /> Password: <asp:TextBox ID="txtPassword" runat="server" TextMode="Password"></asp:TextBox> <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtPassword" ErrorMessage="Password is required" ForeColor="White"></asp:RequiredFieldValidator><br /> <br /> <asp:Button ID="btnLogin" runat="server" BackColor="White" Text="Login" Width="104px" OnClick="CheckLogin" /> <asp:Button ID="btnBack" runat="server" BackColor="White" OnClick="btnBack_Click" Text="Back" Width="104px" /> <br /> <br /> <a href="Register.aspx" target="_blank"><span style="font-size: 14pt; color: #ffffff"> Register!</span></a><span style="font-size: 14pt; color: #ffffff"> </span> <br /> <br /> <asp:Label ID="lblMSG" runat="server" Height="30px" Width="212px"></asp:Label> </form> </body> </html>
http://img.photobucket.com/albums/v7...rush/Login.jpg --print sceen of my login.aspx
![]() |
Similar Threads
- Updated : Simple ASP.Net Login Page (ASP.NET)
- Simple ASP.Net Login Page (Using VB.Net) (ASP.NET)
- Error message when running ASP login page (ASP)
Other Threads in the C# Forum
- Previous Thread: read text file
- Next Thread: how to set default focus on button in winform
| Thread Tools | Search this Thread |
Tag cloud for C#
.net access algorithm array barchart bitmap box buttons c# chat check checkbox class client color combobox control conversion csharp custom database datagrid datagridview dataset datetime degrees draganddrop drawing encryption enum event excel file files form format forms ftp function gdi+ httpwebrequest image index input install java label list listbox listener login mandelbrot math mouseclick mysql networking object operator oracle path photoshop picturebox pixelinversion post prime programming radians regex remote remoting resource richtextbox save saving serialization server sleep socket sql statistics stream string table tcp text textbox thread time timer treeview update usercontrol validation view visualstudio webbrowser windows winforms wpf xml





