• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2101
  • Last Modified:

Trying to get simple ModalPopupExtender to work

I'm learning ASP.NET still.   I'm trying to get the ModalPopupExtender to work as a simple example so I can run with it, but I'm stuck with the error.

Unknown server tag 'ajaxToolkit:ModalPopupExtender'.

What am I doing wrong?    Code is below.   And any other advice or samples would be helpful.
<%@ Page Language="VB" AutoEventWireup="true"  %> 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head id="Head1" runat="server"> 
    <title>Modal Popup Demo</title> 
    <style> 
    .backgroundColor 
    { 
        background-color:Gray;    
        filter:alpha(opacity=25); 
    } 
    </style> 
</head> 
<body> 
    <form id="form1" runat="server"> 
    <div> 
<ajaxToolkit:ModalPopupExtender ID="popExtender" runat="server" 
		    TargetControlID="lnkDummy"
                    CancelControlID="btnAddressCancel" 
                    PopupControlID="pnlNewAddress" 
                    BackgroundCssClass="popup_background" />

                    <div class="DetailsView">
                        <div class="DetailsView-Data">
                            <ul>
                                <li><span class="DetailsView-Name"></span><span class="DetailsView-Value">
                                    <asp:CheckBox ID="chkAlso" runat="server" CssClass="checkbox" Text='<%$ Resources: Address, ContentText_CanAlsoBeUsedAsBillingAddress %>' /></span></li>
                                <li><span class="DetailsView-Name"></span><span class="DetailsView-Value">
                                    <asp:CheckBox ID="chkMakeDefault" runat="server" CssClass="checkbox" Text='<%$ Resources: Address, ContentText_SetAsDefault %>' /></span></li>
                            </ul>
                            <div class="submitbuttons">
                                <asp:Button CssClass="button" ID="btnSaveNewAddress" runat="server" Text='<%$ Resources: FormButton_Submit %>'
                                    CausesValidation="true" />
                            </div>
                        </div>
                        <asp:LinkButton ID="btnAddressCancel" runat="server" Text="X" CssClass="closebutton linkbutton2" />
                    </div>
                    
                    
                     <asp:LinkButton ID="lnkDummy" runat="server" CausesValidation="false" />
                     
                     
                     
                     
		<asp:Panel ID="pnlNewAddress" runat="server" CssClass="popup" Style="display: none">
                    <h2>
                        <asp:Literal ID="litAddressTitle" runat="server" Text="<%$ Resources:ContentText_Edit%>" /></h2>
                    <user:AddressInput ID="UC_NewEditAddress" DisplayType="Shipping" runat="server" ShowSaveAs="true"
                        AutoPostCountry="false" ValidationGroup="Shipping" />
                    <div class="spacer">
                    </div>
                    <div class="DetailsView">
                        <div class="DetailsView-Data">
                            <ul>
                                <li><span class="DetailsView-Name"></span><span class="DetailsView-Value">
                                    <asp:CheckBox ID="chkAlso" runat="server" CssClass="checkbox" Text='<%$ Resources: Address, ContentText_CanAlsoBeUsedAsBillingAddress %>' /></span></li>
                                <li><span class="DetailsView-Name"></span><span class="DetailsView-Value">
                                    <asp:CheckBox ID="chkMakeDefault" runat="server" CssClass="checkbox" Text='<%$ Resources: Address, ContentText_SetAsDefault %>' /></span></li>
                            </ul>
                            <div class="submitbuttons">
                                <asp:Button CssClass="button" ID="btnSaveNewAddress" runat="server" Text='<%$ Resources: FormButton_Submit %>'
                                    CausesValidation="true" />
                            </div>
                        </div>
                        <asp:LinkButton ID="btnAddressCancel" runat="server" Text="X" CssClass="closebutton linkbutton2" />
                    </div>
                </asp:Panel>                     
    </div> 
    </form> 
</body> 
</html>

Open in new window

0
saturation
Asked:
saturation
  • 2
  • 2
  • 2
1 Solution
 
Imran Javed ZiaConsultant Software Engineer - .NET ArchitectCommented:
Just change the code as following

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>  
<asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>

<%@ Page Language="VB" AutoEventWireup="true"  %>   

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

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">   
<html xmlns="http://www.w3.org/1999/xhtml">   
<head id="Head1" runat="server">   
    <title>Modal Popup Demo</title>   
    <style>   
    .backgroundColor   
    {   
        background-color:Gray;      
        filter:alpha(opacity=25);   
    }   
    </style>   
</head>   
<body>   
    <form id="form1" runat="server">   
<asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
    <div>   
<ajaxToolkit:ModalPopupExtender ID="popExtender" runat="server"   
                    TargetControlID="lnkDummy"  
                    CancelControlID="btnAddressCancel"   
                    PopupControlID="pnlNewAddress"   
                    BackgroundCssClass="popup_background" />  
  
                    <div class="DetailsView">  
                        <div class="DetailsView-Data">  
                            <ul>  
                                <li><span class="DetailsView-Name"></span><span class="DetailsView-Value">  
                                    <asp:CheckBox ID="chkAlso" runat="server" CssClass="checkbox" Text='<%$ Resources: Address, ContentText_CanAlsoBeUsedAsBillingAddress %>' /></span></li>  
                                <li><span class="DetailsView-Name"></span><span class="DetailsView-Value">  
                                    <asp:CheckBox ID="chkMakeDefault" runat="server" CssClass="checkbox" Text='<%$ Resources: Address, ContentText_SetAsDefault %>' /></span></li>  
                            </ul>  
                            <div class="submitbuttons">  
                                <asp:Button CssClass="button" ID="btnSaveNewAddress" runat="server" Text='<%$ Resources: FormButton_Submit %>'  
                                    CausesValidation="true" />  
                            </div>  
                        </div>  
                        <asp:LinkButton ID="btnAddressCancel" runat="server" Text="X" CssClass="closebutton linkbutton2" />  
                    </div>  
                      
                      
                     <asp:LinkButton ID="lnkDummy" runat="server" CausesValidation="false" />  
                       
                       
                       
                       
                <asp:Panel ID="pnlNewAddress" runat="server" CssClass="popup" Style="display: none">  
                    <h2>  
                        <asp:Literal ID="litAddressTitle" runat="server" Text="<%$ Resources:ContentText_Edit%>" /></h2>  
                    <user:AddressInput ID="UC_NewEditAddress" DisplayType="Shipping" runat="server" ShowSaveAs="true"  
                        AutoPostCountry="false" ValidationGroup="Shipping" />  
                    <div class="spacer">  
                    </div>  
                    <div class="DetailsView">  
                        <div class="DetailsView-Data">  
                            <ul>  
                                <li><span class="DetailsView-Name"></span><span class="DetailsView-Value">  
                                    <asp:CheckBox ID="chkAlso" runat="server" CssClass="checkbox" Text='<%$ Resources: Address, ContentText_CanAlsoBeUsedAsBillingAddress %>' /></span></li>  
                                <li><span class="DetailsView-Name"></span><span class="DetailsView-Value">  
                                    <asp:CheckBox ID="chkMakeDefault" runat="server" CssClass="checkbox" Text='<%$ Resources: Address, ContentText_SetAsDefault %>' /></span></li>  
                            </ul>  
                            <div class="submitbuttons">  
                                <asp:Button CssClass="button" ID="btnSaveNewAddress" runat="server" Text='<%$ Resources: FormButton_Submit %>'  
                                    CausesValidation="true" />  
                            </div>  
                        </div>  
                        <asp:LinkButton ID="btnAddressCancel" runat="server" Text="X" CssClass="closebutton linkbutton2" />  
                    </div>  
                </asp:Panel>                       
    </div>   
    </form>   
</body>   
</html>

Open in new window

0
 
saturationAuthor Commented:
Now I'm getting:

'lnkYes_Click' is not a member of 'ASP.loanapplication_aspx'.

What is this error?
0
 
Imran Javed ZiaConsultant Software Engineer - .NET ArchitectCommented:
Please check your code behind for this
as i cannot find any such object lnkYes  in aspx code
0
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

 
saturationAuthor Commented:
Ok, put that code in place....Now:

Could not load file or assembly 'AjaxControlToolkit' or one of its dependencies. The system cannot find the file specified.

The error line is

 <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>  
0
 
saritapatelSoftware developerCommented:
Add this 2 ajax file to bin folder
0
 
saritapatelSoftware developerCommented:
http://programming.top54u.com/post/ASP-Net-AJAX-Control-Toolkit.aspx

Add ASP.Net AJAX Control Toolkit from above link

and
 How to install AJAX Control Toolkit is also given on following site

http://programming.top54u.com/post/How-to-install-AJAX-Control-Toolkit.aspx
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

  • 2
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now