Login form in collapsible panel extender

I want to display login form on a collapsible panel extender for login a user. Please help me for this Ajax problem.

Answers


I got the answer but. It is working only with IE. It is not working with Firefox. Your comments are honored.

//add first script manager

Then.....

                    

 

           <div class="secpanel">
           <table id="login">
                <tr>
                <td colspan="2"></td>
            </tr>
               <tr>
                   <td colspan="2">
                       &nbsp;</td>
               </tr>
            <tr>
                <td>User name:</td>
                <td>
                    <asp:TextBox ID="usrtxt" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td></td>
                <td></td>
            </tr>
               <tr>
                   <td>
                       &nbsp;</td>
                   <td>
                       &nbsp;</td>
               </tr>
            <tr>
                <td>Password:</td>
                <td>
                    <asp:TextBox ID="passtxt" TextMode="Password" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td></td>
                <td></td>
            </tr>
               <tr>
                   <td>
                       &nbsp;</td>
                   <td>
                       &nbsp;</td>
               </tr>
            <tr>
                <td></td>
                <td>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    <asp:Button ID="loginbtn" runat="server" Text="Login" ValidationGroup="g1" 
                        onclick="loginbtn_Click"/></td>
            </tr>
               <tr>
                   <td colspan="2">
                       &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                       <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                           ErrorMessage="Please enter user name" ControlToValidate="usrtxt" 
                           ForeColor="Red" ValidationGroup="g1"></asp:RequiredFieldValidator>
                   </td>
               </tr>
               <tr>
                   <td colspan="2">
                       &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                       <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                           ErrorMessage="Please enter password" ControlToValidate="passtxt" 
                           ForeColor="Red" ValidationGroup="g1"></asp:RequiredFieldValidator>
                   </td>
               </tr>
               <tr>
                   <td colspan="2">
                       &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                       <asp:Label ID="err" runat="server" Text=""></asp:Label>
                       &nbsp;</td>
               </tr>
               <tr>
                    <td colspan="2">
                        &nbsp;</td>
               </tr>

           </table>
          </div>
        </asp:Panel>


             <asp:CollapsiblePanelExtender ID="CollapsiblePanelExtender1" TargetControlID="secpanel" CollapseControlID="fstpanel" ExpandDirection="Vertical" TextLabelID="lbl" CollapsedText="Click to login" ExpandedText="Hide" CollapsedSize="0" ExpandedSize="200" ExpandControlID="fstpanel" Collapsed="true" ScrollContents="false" runat="server">
             </asp:CollapsiblePanelExtender>

//code for the submit button

        SqlConnection con = new SqlConnection();
        con.ConnectionString = ConfigurationManager.ConnectionStrings["hw"].ConnectionString.ToString();
            con.Open();
            SqlCommand cmd = new SqlCommand("select * from Login where Admin_name=@", con);
            //cmd.Parameters.Add("@user", usrtxt.Text);
            //cmd.Parameters.AddWithValue("@user", usrtxt.Text);
            SqlDataReader dr = cmd.ExecuteReader();
            while (dr.Read())
            {
                if((usrtxt.Text==dr.GetString(1)) && (passtxt.Text==dr.GetString(2)))
                {
                    Session["admin"]=dr.GetString(1);
                    Response.Redirect("Admin.aspx");
                }
                else
                {
                    err.Text="You are not autorized";
                }
                cmd.Dispose();
            }
            con.Close();

It May be some browser problem. try out with another browser.


I think your code is incomplete. If you want to implement Collapsible Panel ... You have to use two panels one for Header and another for Content. Finally set the options as below in Collapsible Panel Extender.

 <Ajax:CollapsiblePanelExtender ID="CollapsiblePanelext1" runat="server"   CollapseControlID="pnl1Head" Collapsed="true" ExpandControlID="pnl1Head" TextLabelID="lblMessage" CollapsedText="Show" ExpandedText="Hide" ImageControlID="imgArrows" ExpandDirection="Vertical" TargetControlID="pnl2Content" ScrollContents="True" ExpandedImage="../images/collapse_blue.jpg" CollapsedImage="../images/expand_blue.jpg"> </Ajax:CollapsiblePanelExtender>

Need Your Help

Pdf file in UIWebview with password

iphone objective-c xcode uiwebview

I would like to specify the password of a PDF file in my request. Is this possible?

Php mysql LOWER function with AES_DECRYPT

php mysql database

I have AES encrypted data stored in the database using php mysql. Which I entered using AES_ENCRYPT. Problem is that data is coming from iphone and "first name" of member is coming with first lette...