Click here to Skip to main content
15,886,070 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

I am working on a design of a homepage. On my page I am trying some ajax control like model popup extender.
I am placing all the contents in a table format.

XML
<cc1:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
 </cc1:ToolkitScriptManager>
 <asp:Panel ID="Panel3" runat="server">
 <table width="100%">
 <tr>
  <td style="height:72px; width: 955px;">
   <table>
    <tr>
    <td style="width: 248px; vertical-align:top;" align="center">
        <span style=" font-family:Verdana; font-size: 8pt; color:Teal; text-decoration:blink" >
         Have An Account</span>&nbsp;
        <asp:Button ID="Button2" runat="server" Text="Login" onclick="Button2_Click"  />
     </td>
    </tr>

   </table>
  </td>
 </tr>
 </table>
 </asp:Panel>

 <asp:Panel ID="moveMe" runat="server" HorizontalAlign="Center" Style="display: none" BackColor="Green">
  <asp:Label ID="Label1" runat="server" Text="UserName"></asp:Label>&nbsp;:&nbsp;
  <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
  <br />
  <asp:Label ID="Label2" runat="server" Text="Password"></asp:Label>&nbsp;:&nbsp;&nbsp;
  <asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
  &nbsp;&nbsp;&nbsp;&nbsp;
  <asp:Button ID="lnkBtnCloseColHelp" runat="server" Text="Button" />
 </asp:Panel>


The code for Button click is as below:

protected void Button2_Click(object sender, EventArgs e)
{
  AjaxControlToolkit.ModalPopupExtender modalPop = new AjaxControlToolkit.ModalPopupExtender();
  modalPop.ID = "popUp";
  modalPop.PopupControlID = "moveMe";
  modalPop.TargetControlID = "Button2";
  modalPop.DropShadow = true;
  modalPop.BackgroundCssClass = "modalBackground";
  modalPop.CancelControlID = "lnkBtnCloseColHelp";
  modalPop.Show();
}


Here on login button I'm trying to pop up a panel containing Username and password and login button. But, the model pop up is not working. I also tried the animation extender but that also didn't work. I am not getting what the problem is?. :confused:
Posted
Updated 19-Dec-10 19:33pm
v2
Comments
Sandeep Mewara 20-Dec-10 1:32am    
Elaborate more on what you mean by 'not working'? Is there an error? server or client (javascript)?
JF2015 20-Dec-10 1:34am    
Edited to fix code formatting.

In my opinion it will be a good idea to Use the Markup rather then the server side code.

VB
<
ajaxToolkit:ModalPopupExtender ID="MPE" runat="server"
    TargetControlID="Button2"
    PopupControlID="MoveMe"
    DropShadow="true"
    OkControlID="Loginbuttonhere"
    CancelControlID="lnkBtnCloseColHelp"



Regards
Ahsan Sarfraz


Dont forget to mark as answered if the info is useful
 
Share this answer
 
treterte
retr<br />
eeeeeeeeeterteeeeeeee<br />
eeeeeeeeeeee
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900