Hello All AJAX Gurus,

I have the following issue:

I have an AJAX ModalPopUpExtender control which brings up a panel which has a field to enter User Name and Password. The panel also contins an OK and Cancel Buttons.Here is the code for the panel and the ModalPopUpExtender.
<div id="PanelInfo">
<asp:Button ID="Button1" runat="server" Text="Click here"/>&nbsp;
 <asp:Panel ID="Panel1" runat="server" Style="display: none" CssClass="modalPopup">
         <td><asp:Label runat="server" ID="lblUserName" Text="User Name:"/></td>
         <td><asp:TextBox runat="server" ID="txtUserName" /></td>
         <td><asp:Label runat="server" ID="lblPassword" Text="Password:"/></td>
         <td><asp:TextBox runat="server" ID="txtPassword" /></td>
         <td><asp:Button ID="OkButton" runat="server" Text="OK" OnClick="OkButton_Click"/></td>
         <td><asp:Button ID="CancelButton" runat="server" Text="Cancel" /></td>

<cc1:ModalPopupExtender ID="ModalPopupExtender1" runat="server"

and in my .cs file I have


protected void Page_Load(object sender, EventArgs e)
        ModalPopupExtender1.Show(); //show the dialog box in which trhe user needs to enter their user name and password

I want to take the information entered by the user and use it to query a Database table.

I know how to do all that in a regular environment but the problem I am having with AJAX controls is that the program execution never gets to the OK button's click Event and I partially understand that this can be becausee the page never reloads and since the CLick event occurs after the Load event, the click event never happens. So I don't know where to place my code to access the DataBase and query the table.

Does anyone know how to handle the above scenario?

Thanks Very much in advance