I am relatively new to ASP.NET so I am hoping someone can help point me in the right direction.
I am creating a wedding website which will only display content if a user logs in from a login control at the top of the page.
I have a database created in SQL Server with a Table called Users that has a 6 digit int called U_ID and a 5 digit string called U_Code, and each guest to the wedding will get this ID and Code to log-in and view the website content.
I have updated my connection string in Web.Config to link to this database.
<add name="WeddingConnectionString1" connectionString="Data Source=MYPC;Initial Catalog=Wedding;Integrated Security=True" providerName="System.Data.SqlClient" />
But now I do not know how to use a login control that uses this database to allow logins.
Here is the code for my login:
<asp:Login ID="Login1" runat="server" Orientation="Horizontal"
LoginButtonText="Login"
UserNameLabelText="ID:" RememberMeText="" TitleText="" PasswordLabelText="Code:"
DisplayRememberMe="False" OnAuthenticate="Login1_Authenticate">
</asp:Login>
<asp:ValidationSummary ID="ValidationSummary1"
runat="server" ForeColor="#FF0066" Height="32px" ValidationGroup="Login1"
Width="203px"
/>
</login>
So I need to figure out what goes in here:
protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
{
}
Please help me if you can or point me somewhere that helps me do this. Thank you!