I am newbie in asp.net C#. I created a login.aspx
<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Default3.aspx.cs" Inherits="Default3" Title="Untitled Page" %> <asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server"> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="Main" Runat="Server"> </asp:Content> <asp:Content ID="Content3" ContentPlaceHolderID="Navigation" Runat="Server"> </asp:Content> <asp:Content ID="Content4" ContentPlaceHolderID="Footer" Runat="Server"> </asp:Content> <asp:Content ID="Content5" runat="server" contentplaceholderid="RightTopContent"> <asp:Image ID="Image1" runat="server" Height="26px" Width="162px" /> <br /> Username :<asp:TextBox ID="txtUserName" runat="server"></asp:TextBox> <br /> Password :<asp:TextBox ID="txtPassword" runat="server"></asp:TextBox> <br /> <asp:Button ID="btnSubmit" runat="server" onclick="btnSubmit_Click" Text="Login" /> <br /> </asp:Content> <asp:Content ID="Content6" runat="server" contentplaceholderid="RightMiddleContent"> </asp:Content>
But, I do not know the way of writing code(syntax) in login.aspx.cs which I would like to check the user input(username,password) match with the SQL database or not? If the user input is correct in SQL DB then it will redirect to user information page,if not will appear an error page.
I just know how to connect SQL DB in C# asp.net but I do not know the syntax of checking the user input is matching/correct with the SQL DB or not?
Anyone can help?
Thanks.
Regards,
Katelva

New Topic/Question
Reply



MultiQuote




|