Nethra R S

Nethra R S

  • NA
  • 310
  • 335.2k

Want to hide modalpopup control at cancel button

Jul 14 2011 6:53 AM
The html source is as below:

<%@ Page Language="C#" MasterPageFile="~/Home.master" AutoEventWireup="true" CodeFile="frmLogin.aspx.cs" Inherits="frmLogin" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"></asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"></asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="cphsubmenu" runat="server">

    <ul>
<li>
    <asp:LinkButton ID="loginbtn" runat="server">Log in</asp:LinkButton>
</li>
</ul>
    <cc1:ModalPopupExtender ID="ModalPopupExtender1"  DropShadow="true" TargetControlID="loginbtn" PopupControlID="Panel1" runat="server">
    </cc1:ModalPopupExtender>
    <asp:Panel ID="Panel1" runat="server" Width="350px" CssClass="modalLogin">
   
  <table border="0" cellspacing="1" cellpadding="1" width="350px">
    <tr>
      <td>
          <asp:Label ID="lblusername" runat="server" ForeColor="#CC3300" Text="Username:"></asp:Label>
        </td>
      <td>
          <asp:TextBox ID="txtusername" runat="server"></asp:TextBox>
          <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
              ControlToValidate="txtusername" Display="None"
              ErrorMessage="Please enter username"></asp:RequiredFieldValidator>
         <%-- <cc1:ValidatorCalloutExtender ID="RequiredFieldValidator1_ValidatorCalloutExtender"
              runat="server" Enabled="True" TargetControlID="RequiredFieldValidator1" BehaviorID="textValidator">
          </cc1:ValidatorCalloutExtender>--%>
        </td>
    </tr>
    <tr>
      <td>
          <asp:Label ID="lblpassword" runat="server" ForeColor="#CC3300" Text="Password:"></asp:Label>
        </td>
      <td>
          <asp:TextBox ID="txtpwd" runat="server"></asp:TextBox>
          <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
              ControlToValidate="txtpwd" Display="None" ErrorMessage="Please enter password"></asp:RequiredFieldValidator>
        </td>
    </tr>
    <tr align="center">
      <td colspan="2">
          <asp:Button ID="btnlogin" runat="server" Text="Login"
              onclick="btnlogin_Click" />
          <asp:Button ID="btncancel" runat="server" Text="Cancel"
              onclick="btncancel_Click" />
        </td>
    </tr>
    <tr>
      <td colspan="2" align="center">
          <asp:Label ID="lblmsg" runat="server" ForeColor="#CC3300"></asp:Label>
        </td>
    </tr>
  </table>

    </asp:Panel>
</asp:Content>
============================
At cancel button the whole panel1(containing the login control created) should hide. How do i do it plzz help

Answers (2)