I have a basic comment page (code below) that I made in Visual Studio 2010 using GridView and FormView. The user fills in the text boxes, the info is put into the database and then inserted into my GridView. I want to password protect the form, so that not only does the person have to enter their name and comment, but they have to supply the correct password.
I know there are many ways to provide some type of password to a page, so any help is much appreciated.
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<div id="commentpanel">
<asp:GridView ID="GridView1" runat="server" CellPadding="4"
DataSourceID="SqlDataSource1" ForeColor="#333333" GridLines="None"
DataKeyNames="commentor_id" AllowSorting="True" AutoGenerateColumns="False">
<AlternatingRowStyle BackColor="White" ForeColor="#284775" />
<Columns>
<asp:CommandField ShowDeleteButton="True" />
<asp:BoundField DataField="name" HeaderText="Name" SortExpression="name" />
<asp:BoundField DataField="comments" HeaderText="Comments"
SortExpression="Comments" />
<asp:BoundField DataField="date" HeaderText="Date" SortExpression="date" />
</Columns>
<EditRowStyle BackColor="#999999" />
<FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
<RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
<SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
<SortedAscendingCellStyle BackColor="#E9E7E2" />
<SortedAscendingHeaderStyle BackColor="#506C8C" />
<SortedDescendingCellStyle BackColor="#FFFDF8" />
<SortedDescendingHeaderStyle BackColor="#6F8DAE" />
</asp:GridView>
</div>
<br />
<asp:FormView ID="FormView1" runat="server" DataSourceID="SqlDataSource1"
DefaultMode="Insert">
<InsertItemTemplate>
Name: <asp:TextBox ID="txtName" runat="server" Text='<%# Bind("name") %>'></asp:TextBox><br />
Comment (150 characters):<br />
<asp:TextBox ID="txtComments" runat="server" onkeypress="return imposeMaxLength(this, 150);" Text='<%# Bind("comments") %>'
TextMode="MultiLine" Rows="4" Columns="50"></asp:TextBox><br />
<asp:HiddenField ID="hidTimeDate" runat="server" Value='<%# Bind("date") %>' />
<asp:Button ID="butSubmit" runat="server" CommandName="Insert" Text="Submit" />
</InsertItemTemplate>
</asp:FormView>
</ContentTemplate>
</asp:UpdatePanel>