Hello
i need to design a login. When the user enters his username, the text that has been inputted must automatically search through the database then when he enters his password and clicks submit, he should be redirected to User.aspx if the password matches the username.
here are the textboxes and button:
<asp:TextBox CssClass="input" ID="Username" runat="server" placeholder="lynda" >
<asp:TextBox CssClass="input" ID="Password" runat="server" placeholder="Password" TextMode="Password">
<asp:Button ID="Button1" CssClass="button" runat="server" Text="Submit" OnClick="Button1_Click" />
here is the database:
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="ID" DataSourceID="SqlDataSource1">
<Columns>
<asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" ReadOnly="True" SortExpression="ID" />
<asp:BoundField DataField="Username" HeaderText="Username" SortExpression="Username" />
<asp:BoundField DataField="Password" HeaderText="Password" SortExpression="Password" />
<asp:BoundField DataField="LoginRetrieveQuestion" HeaderText="LoginRetrieveQuestion" SortExpression="LoginRetrieveQuestion" />
<asp:BoundField DataField="LoginRetrieveAnswer" HeaderText="LoginRetrieveAnswer" SortExpression="LoginRetrieveAnswer" />
<asp:BoundField DataField="Client" HeaderText="Client" SortExpression="Client" />
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" SelectCommand="SELECT [ID], [Username], [Password], [LoginRetrieveQuestion], [LoginRetrieveAnswer], [Client] FROM [LoginTable]"></asp:SqlDataSource>
ive tried alot of ways but i just couldnt do it. Your help is needed