2011-06-23 2 views
0

J'ai tout fait. Supprimé le code et fait glisser de nouveaux contrôles de la boîte à outils, renommé, essayé de javascript - Je ne peux pas obtenir ce modalpopupextender monstre à montrer. Gaspillé 3 jours. J'essaie de le montrer via VB code-behind dans l'on-click même du bouton de connexion. Tout exécute autre dans le code du bouton, mais pas cette ligne:ModalPopup ne s'affiche pas dans ASP.Net

Mais peu importe ce que j'essaie, il aime rester caché.

Toutes les idées seraient les bienvenues !!! Merci,

Jason

PS - voici le ASPX codage

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Login.aspx.vb" Inherits="LetterWriterASP.Login" %> 

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> 


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 

<html> 
<head id="Head2"><meta http-equiv="Expires" content="-1" /><title> 
Anchor General Insurance Agency, Inc. 
</title><meta http-equiv="Expires" content="-1" /><link rel="shortcut icon" href="Images/favicon.ico" /><link href="App_Themes/Default/Calendar.css" type="text/css" rel="stylesheet" /><link href="App_Themes/Default/Default.css" type="text/css" rel="stylesheet" /> 
    </head> 

<style type="text/css"> 
    .ModalPopupBG 
    { 
    background-color: #666699; 
    filter: alpha(opacity=50); 
    opacity: 0.7; 
    } 

    .HellowWorldPopup 
    { 
    min-width:200px; 
    min-height:100px; 
    background:white; 
    border-color:Silver; 
    border-style:ridge; 
    border-width:medium; 

    } 
    .HeaderStyle 
    { 
    color:Black; 
    background-color:Black; 
    border-style:solid; 
    } 
    .PopupHeader 
    { 
    color:Black; 
    background-color: Black; 
    } 
</style> 


<body leftmargin="0" topmargin="0" 
background="Images/tile-grey-stripe.jpg"> 
<form id="Form1" runat="server"> 



    <table width="1000" height="99" border="0" align="center" cellpadding="0" cellspacing="0"> 
     <tr> 
      <td width="35" background="../Images/a_ag01.jpg"></td> 
      <td width="524"><img src="Images/a_ag1.jpg" alt="" width="524" height="99" border="0" align="top" /></td> 
      <td width="389"> 
       <table border="0" cellspacing="0" cellpadding="0" width="389"> 
        <tr> 
         <td width="218"><img id="imgHeader" src="Images/text_title_producer1.jpg" style="height:99px;width:218px;border-width:0px;" /></td> 
      <td width="111"><img id="imgHeadr2" src="Images/text_title-TILE.jpg" style="height:99px;width:171px;border-width:0px;" /></td> 
        </tr> 
       </table> 
      </td> 
      <td width="19" align="right"><img src="Images/a_ag4_end.jpg" width="19" height="99" alt="" /></td> 
      <td align="right" width="33" background="Images/a_ag5.jpg"></td> 
     </tr> 
    </table> 
    <!--end of the header table --> 
    <table height="702" width="1000" border="0" cellpadding="0" cellspacing="0" align="center"> 
     <tr> 
      <td width="50" background="Images/b_ag1_lefttile.jpg"> <!-- This is the left wall of the form !--> 
       &nbsp;</td> 
      <td width="900" valign="top" bgcolor="#FFFFFF"> 
<!-- Text, controls, buttons, etc goes below this comment. !--> 

<script type="text/javascript"> 

function InvalidLogin() 
{ 
alert("Invalid user name or password. Please try again."); 
window.location = "../Login.aspx"; 
} 

function ShowModal() 
{$find('ModalPopupExtender2').show();} 


</script> 



         <br /><br /><br /><br /><br /><br /><br /> 
         <center><table border="2" cellpadding="4" cellspacing="0" 
          style="border-collapse:collapse;"> 
          <tr> 
           <td> 
            <table border="0" cellpadding="0" style="height:172px;width:278px;"> 
             <tr> 
              <td align="center" colspan="2" 
               style="color:White;background-color:#5D7B9D;font-size:0.9em;font-weight:bold;"> 
               Log In</td> 
             </tr> 
             <tr> 
              <td align="right"> 
               <asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">User 
               Name:</asp:Label> 
              </td> 
              <td> 
               <asp:TextBox ID="UserName" Width="150" name="UserName" runat="server" Font-Size="0.8em"></asp:TextBox> 
               <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" 
                ControlToValidate="UserName" ErrorMessage="User Name is required." 
                ToolTip="User Name is required." ValidationGroup="Login1">*</asp:RequiredFieldValidator> 
              </td> 
             </tr> 
             <tr> 
              <td align="right"> 
               <asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">Password:</asp:Label> 
              </td> 
              <td> 
               <asp:TextBox ID="Password" Width="150" runat="server" Font-Size="0.8em" TextMode="Password"></asp:TextBox> 
               <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" 
                ControlToValidate="Password" ErrorMessage="Password is required." 
                ToolTip="Password is required." ValidationGroup="Login1">*</asp:RequiredFieldValidator> 
              </td> 
             </tr> 
             <tr> 
              <td align="center" colspan="2" style="color:Red;"> 
               <asp:Literal ID="FailureText" runat="server" EnableViewState="False"></asp:Literal> 
              </td> 
             </tr> 
             <tr> 
              <td align="right" colspan="2"> 
               <asp:Button ID="LoginButton" runat="server" BackColor="#FFFBFF" 
                BorderColor="#CCCCCC" BorderStyle="Solid" BorderWidth="1px" CommandName="Login" 
                Font-Names="Verdana" Font-Size="0.8em" ForeColor="#284775" 
                onclick="LoginButton_Click1" Text="Log In" ValidationGroup="Login1" /> 
              </td> 
             </tr> 
            </table> 
           </td> 
          </tr> 
         </table>  </center>    


<!-- Text, controls, buttons, etc goes above this comment. !-->  
       <!--"#E6E2D8" "Black"-->  
      </td> 
      <td width="50" background="Images/b_ag1_righttile.jpg"> <!-- This is the right wall !--> 
       &nbsp;</td> 
     </tr> 
    </table> 
    <!--end of content table --> 
    <table height="75" width="1000" border="0" align="center" cellpadding="0" cellspacing="0"> 
     <tr> 
      <td width="80" background="Images/c_ag1_leftcorner.jpg"></td> 
      <td width="840" align="center" valign="top" background="Images/c_ag1_center-piece.jpg" class="contents"> 
       <span id="lblFooter"><center>Copyright &#0169; 2006 Anchor General Insurance Agency, Inc. All rights reserved. <br />For questions, please call: (800) 542-6246</center></span> 
      </td> 
      <td width="80" background="Images/c_ag1_rightcorner.jpg"></td> 
     </tr> 
    </table> 







<!-- Popup Form --> 
<asp:ToolkitScriptManager ID="ToolkitScriptManager2" runat="server" EnablePageMethods="true"> 
         </asp:ToolkitScriptManager> 
<asp:button id="Button3" name="Button3" runat="server" text="Button" style="display: none;" /> 

<asp:ModalPopupExtender ID="ModalPopupExtender2" runat="server" 
targetcontrolid="Button3" popupcontrolid="PopupPanel" 
popupdraghandlecontrolid="PopupHeader2" drag="true" 
backgroundcssclass="ModalPopupBG"> 
</asp:ModalPopupExtender> 

<asp:Panel ID="PopupPanel" style="display: none" runat="server"> 
    <div class="HellowWorldPopup"> 
      <div class="PopupHeader" id="PopupHeader2">&nbsp;</div> 
      <div class="Controls"> 
       <center><table border=0 cellpadding=0 cellspacing=0><tr><td><img src="Images/ajax-loader.gif" /></td><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Please Wait...</td></tr></table></center> 
      </div> 
    </div> 
</asp:Panel> 


</form> 
</body> 
</html> 

Répondre

0

Venez découvrir (après un très long processus d'essais et d'erreurs), il y a un petit quelque chose que chacun devrait connaître.

Vous ne pouvez pas copier le code

<ToolkitScriptManager> 

d'une page ASPX à un autre. Vous DEVEZ le faire glisser de la boîte à outils sur votre page. Je suppose qu'il fait des choses que nous ne voyons pas ou que nous ne connaissons pas. Idem pour ModalPopupExtender.

Espérons que cela aide quelqu'un!

Questions connexes