locked
ModalPopUpExtender no working. RRS feed

  • Question

  • User607275339 posted

    Ok, I am pretty new to programming in general, and I am very new to ASP.NET/C#.

    I spent about 30 minutes making this and then the entire rest of the day trying to make it work.  I've followed guides on websites, the sample website from ajax, and youtube and I have no idea what I am doing wrong.

    What I want is to have a popup window appear when a button is pressed so that a user can entire in a few pieces of data and then submit it to a mssql db.  I don't care about the sql coding right now, I just want the popup to appear on the screen when I click the button.

    Page Code:

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="viewTicket.aspx.cs" Inherits="CWTS.viewTicket" %>
    
    <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
    
    
    <!DOCTYPE html>
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
    <title>View</title>
      <link rel="stylesheet" type="text/css" href="Content/Site.css" />
      <script type="text/javascript" src="Scripts/jquery.min.js"></script>
      <script type="text/javascript" src="Scripts/image_slide.js"></script>
    </head>
    <body>
         <form id="form1" runat="server">
             <ajaxToolkit:toolkitscriptmanager runat="server"></ajaxToolkit:toolkitscriptmanager>
    
    <div id="content">
    <h2>Events:</h2>
               <br />   
                    <asp:Button ID="btnEvent" runat="server" Text="Add Event" OnClick="btnEvent_Click" />
                     <asp:Panel ID="pEvent" runat="server" Style="display: none" CssClass="modalPopup">
                         <asp:Panel ID="Panel1" runat="server" style="border:solid 2px #cccccc; width:98%; cursor: move;">Drag Panel</asp:Panel>
                         <div>Test
                         <asp:Button ID="btnEventSubmit" runat="server" Text="Submit" /><asp:Button ID="btnEventCancel" runat="server" Text="Cancel" />
                        </div>
                             </asp:Panel>
               <ajaxToolkit:ModalPopupExtender ID="pEventExtender" DropShadow="true" PopupDragHandleControlID="Panel1" runat="server" 
                            BackgroundCssClass="modalBackground" CancelControlID="btnEventCancel" 
                            OkControlID="btnEventSubmit" PopupControlID="pEvent" TargetControlID="btnEvent" />

    Codebehind:

            protected void btnEvent_Click(object sender, EventArgs e)
            {
                pEventExtender.Show();
            }

    Css:

    .modalBackground {
        background-color: gray;
        filter: alpha(opacity=70);
        opacity: 0.7;
    }
    .modalPopup {
        background-color: #ccc;
        border-width: 3px;
        border-style: solid;
        border-color: gray;
        padding: 3px;
        width: 300px;
    
       }

    This is killing me, because it will look so much nicer to have the pop up instead of going to a second page or having the form built into the page itself.

    I get 0 build errors, the panel isn't visible at first, click the button...nothing happens.  No debugging errors when the btn click does nothing.

    I know I probably have a single error somewhere, but I am going crazy trying to figure this out.  Is it because of the javascript I have in the head?

    Any help would be greatly appreciated.

    Tuesday, May 5, 2015 1:32 PM

Answers

  • User1644755831 posted

    Hello nmenforcer,

    Your code seems to work fine. Using the latest AjaxToolKit V15.1  http://ajaxcontroltoolkit.codeplex.com/ I tested it and it works fine.

    1. Download the latest version and install it.

    2. Create new project and create new web form page. you should see a section in the Toolbox for AjaxControlToolKit 15.1

    3. Drag and drop ModalPopupExtender to the page it will automatically add the dependent dlls to the reference.

    4. Drag and drop Script Manager from Ajax Extensions to the page. ToolkitScriptManager is Removed in v15.1 so you will need to use Script Manager see

    http://ajaxcontroltoolkit.codeplex.com/wikipage?title=ToolkitScriptManager%20Removed%20in%20v15.1%2c%20Use%20ScriptManager&referringTitle=Documentation

    5. put other controls and run the website it should work.

    Here is the code I used.

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm20.aspx.cs" Inherits="WebFormsIdentity.WebForm20" %>
    
    <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
    
    <!DOCTYPE html>
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
      <title></title>
    </head>
    <body>
      <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        <div>
          <asp:Button
            ID="btnEvent"
            runat="server"
            Text="Add Event"
            OnClick="btnEvent_Click" />
          <asp:Panel
            ID="pEvent"
            runat="server"
            Style="display: none"
            CssClass="modalPopup">
            <asp:Panel
              ID="Panel1"
              runat="server"
              Style="border: solid 2px #cccccc; width: 98%; cursor: move;">
              Drag Panel
            </asp:Panel>
            <div>
              Test
            <asp:Button
              ID="btnEventSubmit"
              runat="server"
              Text="Submit" />
              <asp:Button
                ID="btnEventCancel"
                runat="server"
                Text="Cancel" />
            </div>
          </asp:Panel>
          <cc1:ModalPopupExtender
            runat="server"
            ID="pEventExtender"
            DropShadow="true"
            PopupDragHandleControlID="Panel1"
            BackgroundCssClass="modalBackground"
            CancelControlID="btnEventCancel"
            OkControlID="btnEventSubmit"
            PopupControlID="pEvent"
            TargetControlID="btnEvent">
          </cc1:ModalPopupExtender>
        </div>
      </form>
    </body>
    </html>
    

    Code Behind

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    
    namespace WebFormsIdentity
    {
      public partial class WebForm20 : System.Web.UI.Page
      {
        protected void Page_Load(object sender, EventArgs e)
        {
    
        }
    
        protected void btnEvent_Click(object sender, EventArgs e)
        {
          pEventExtender.Show();
        }
      }
    }

    Hope this helps.

    With Regards,

    Krunal Parekh

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, May 7, 2015 3:16 AM
  • User2103319870 posted

    Should I be getting the installer and not just the binary?

    AFAIK DevExpress Team maintains the AjaxControlToolkit now.Recently they introduced a installer for AjaxControlToolkit. You can take a look the below links for more details

    https://www.devexpress.com/Products/AJAX-Control-Toolkit/?utm_source=CodePlex&utm_medium=DevExpressPage&utm_campaign=AjaxControlToolkit&utm_content=AjaxControlToolkit_CodePlex_DevExpressPage

    https://ajaxcontroltoolkit.codeplex.com/releases/view/612416

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, May 7, 2015 10:44 AM

All replies

  • User2103319870 posted

    <link rel="stylesheet" type="text/css" href="Content/Site.css" /> <script type="text/javascript" src="Scripts/jquery.min.js"></script> <script type="text/javascript" src="Scripts/image_slide.js"></script>

    I have tried your code with out the Jquery codes in page and it works fine without any issues. As a trouble shooting step can you comment that one and see if ModalPopup is working or not.

    Tuesday, May 5, 2015 3:08 PM
  • User607275339 posted

    I have tried your code with out the Jquery codes in page and it works fine without any issues. As a trouble shooting step can you comment that one and see if ModalPopup is working or not.

    Just tried commenting it out, same result.

    Is it possible that I didn't install AJAXCONTROLTOOLKIT properly?  I used the "add reference" option and then manually added it to my toolbox.  I don't think that is the problem because I am not getting parser or build errors.

    Tuesday, May 5, 2015 3:49 PM
  • User607275339 posted

    Perhaps the problem is elsewhere in my code.  I will just copy my whole page instead of just the part specific to the modalpopupextender.

    Page:

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="viewTicket.aspx.cs" Inherits="CWTS.viewTicket" %>
    
    <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
    
    
    <!DOCTYPE html>
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
    <title>View</title>
      <meta name="description" content="work ticket system" />
      <meta name="keywords" content="work ticket system rims inventory management" />
      <meta http-equiv="content-type" content="text/html; charset=utf-8" />
      <meta http-equiv="X-UA-Compatible" content="IE=9" />
      <link rel="stylesheet" type="text/css" href="Content/Site.css" />
      //<script type="text/javascript" src="Scripts/jquery.min.js"></script>
      //<script type="text/javascript" src="Scripts/image_slide.js"></script>
    </head>
    <body>
         <form id="form1" runat="server">
             <ajaxToolkit:toolkitscriptmanager runat="server"></ajaxToolkit:toolkitscriptmanager>
      <div id="main">
        <div id="header">
    	  <div id="banner">
    	    <div id="welcome">
    	      <h1>CAPCOMM Work Ticket System</h1>
    	    </div><!--close welcome-->
    	    <div id="welcome_slogan">
    	      <h1>View Ticket</h1>
    	    </div><!--close welcome_slogan-->
    	  </div><!--close banner-->
        </div><!--close header-->
    
    	<div id="menubar">
          <ul id="menu">
            <li><a href="Default.aspx">Home</a></li>
            <li><a href="createTicket.aspx">Create</a></li>
            <li class="current"><a href="searchTickets.aspx">Tickets</a></li>
            <li><a href="searchCustomers.aspx">Customers</a></li>
            <li><a href="contact.aspx">Contact</a></li>
          </ul>
        </div><!--close menubar-->	
        
    <div id="site_content">		
    
    	  <div class="sidebar_container">       
    		<div class="sidebar">
              <div class="sidebar_item">
                  <h2>Ticket Number</h2>
                  <h3>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <%: ticket.TICKET_ID %></h3>
              </div>
             </div>
             <div class="sidebar">
              <div class="sidebar_item">
                  <h2>Status</h2>
                  <h3>&nbsp; &nbsp;<%: ticket.STATUS %></h3>
              </div>
             </div>
             <div class="sidebar">
              <div class="sidebar_item">
                  <h2>Action</h2>
                  <h3>&nbsp; &nbsp;<%: ticket.ACTION %></h3>
              </div>
             </div>
              <div class="sidebar">
              <div class="sidebar_item">
                  <h2>Created</h2>
                  <h3>&nbsp; &nbsp; <%: ticket.ENTRY_DATE %></h3>
              </div>
             </div>
              <div class="sidebar">
              <div class="sidebar_item">
                  <h2>Agency</h2>
                  <h3><%: ticket.AGENCY_NAME %></h3>
              </div>
             </div>
             <div class="sidebar">
              <div class="sidebar_item">
                  <h2>Contact</h2>
                  <h3> <a href="mailto:<%: ticket.EMAIL %>"><%: ticket.CONTACT %></a></h3>
                  <p>Primary - <%: ticket.PRIMARY__PHONE %><br />
                  Mobile &nbsp;- <%: ticket.MOBILE_PHONE %><br /></p>
              </div>
             </div>
        </div>
           <div id="content">
               <br />
               <br />
    
    
                <h2>Chief Complaint:</h2>
                <p><%: ticket.CHIEF_COMPLAINT %></p>
                <h2>Address:</h2>
                <p><%: ticket.ADDRESS1 %><br />
                   <%: ticket.ADDRESS2 %>
                   <%: ticket.CITY %>,&nbsp;&nbsp;<%: ticket.ZIP_CODE %><br /></p>
                    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="LinqDataSource1" CssClass="mGrid" PagerStyle-CssClass="pgr" AlternatingRowStyle-CssClass="alt">
                        <Columns>
                            <asp:BoundField DataField="MANUFACTURER" HeaderText="Manufacturer" ReadOnly="True" SortExpression="MANUFACTURER" />
                            <asp:BoundField DataField="MODEL_NUMBER" HeaderText="Model Number" ReadOnly="True" SortExpression="MODEL_NUMBER" />
                            <asp:BoundField DataField="SERIAL_NUMBER" HeaderText="Serial Number" ReadOnly="True" SortExpression="SERIAL_NUMBER" />
                            <asp:BoundField DataField="TX_PWR_FWD" HeaderText="Tx Fwd" ReadOnly="True" SortExpression="TX_PWR_FWD" />
                            <asp:BoundField DataField="TX_PWR_REFL" HeaderText="Tx Refl" ReadOnly="True" SortExpression="TX_PWR_REFL" />
                            <asp:BoundField DataField="MODULATION" HeaderText="Modulation" ReadOnly="True" SortExpression="MODULATION" />
                            <asp:BoundField DataField="BER" HeaderText="BER" ReadOnly="True" SortExpression="BER" />
                            <asp:BoundField DataField="RX_SENS" HeaderText="Rx Sens" ReadOnly="True" SortExpression="RX_SENS" />
                        </Columns>
                    </asp:GridView>
                    <asp:LinqDataSource ID="LinqDataSource1" runat="server" ContextTypeName="CWTS.DataClasses1DataContext" EntityTypeName="" Select="new (MANUFACTURER, MODEL_NUMBER, SERIAL_NUMBER, TX_PWR_FWD, TX_PWR_REFL, MODULATION, BER, RX_SENS)" TableName="VIEW_WT_EQUIPs" Where="TICKET_NUMBER == @TICKET_NUMBER">
                        <WhereParameters>
                            <asp:QueryStringParameter DefaultValue="null" Name="TICKET_NUMBER" QueryStringField="TICKET_ID" Type="Int32" />
                        </WhereParameters>
                    </asp:LinqDataSource>
               <br />
                  <h2>Events:</h2>
               <br />   
                    <asp:Button ID="btnEvent" runat="server" Text="Add Event" OnClick="btnEvent_Click" />
                     <asp:Panel ID="pEvent" runat="server" Style="display: none" CssClass="modalPopup">
                         <asp:Panel ID="Panel1" runat="server" style="border:solid 2px #cccccc; width:98%; cursor: move;">Drag Panel</asp:Panel>
                         <div>Test
                         <asp:Button ID="btnEventSubmit" runat="server" Text="Submit" /><asp:Button ID="btnEventCancel" runat="server" Text="Cancel" />
                        </div>
                             </asp:Panel>
               <ajaxToolkit:ModalPopupExtender ID="pEventExtender" DropShadow="true" PopupDragHandleControlID="Panel1" runat="server" 
                            BackgroundCssClass="modalBackground" CancelControlID="btnEventCancel" 
                            OkControlID="btnEventSubmit" PopupControlID="pEvent" TargetControlID="btnEvent" />
                    <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" DataSourceID="LinqDataSource2" CssClass="mGrid" PagerStyle-CssClass="pgr" AlternatingRowStyle-CssClass="alt">
                        <Columns>
                            <asp:BoundField DataField="COMMENTS" HeaderText="COMMENTS" SortExpression="COMMENTS" />
                            <asp:BoundField DataField="TECHNICIAN" HeaderText="TECHNICIAN" SortExpression="TECHNICIAN" />
                            <asp:BoundField DataField="DATE" HeaderText="DATE" SortExpression="DATE" />
                            <asp:BoundField DataField="LABOR" HeaderText="LABOR" SortExpression="LABOR" />
                        </Columns>
                    </asp:GridView>
                
    
             
               
               <asp:LinqDataSource ID="LinqDataSource2" runat="server" ContextTypeName="CWTS.DataClasses1DataContext" EntityTypeName="" TableName="VIEW_WT_EVENTs" Where="TICKET_NUMBER == @TICKET_NUMBER">
                   <WhereParameters>
                       <asp:QueryStringParameter Name="TICKET_NUMBER" QueryStringField="Ticket_ID" Type="Int32" />
                   </WhereParameters>
               </asp:LinqDataSource>
                
    
             
               
               <div class="content_container">
    		    <h2>Action</h2>
                  <p><%: ticket.ACTION %></p>
                   <asp:DropDownList ID="dlActionChange" runat="server" width="110px" AutoPostBack="true" OnSelectedIndexChanged="dlActionChange_SelectedIndexChanged" DataValueField="ACTION_ID" DataTextField="ACTION">
                    </asp:DropDownList>
    		  	   
    		       <asp:Button ID="btnAction" runat="server" Text="Submit" OnClick="btnAction_Click" />
    		  	   
    		  </div><!--close content_container-->
              <div class="content_container">
    		    <h2>Status</h2>
                  <p><%: ticket.STATUS %></p>
                  <asp:DropDownList ID="dlStatusChange" runat="server" width="110px" AutoPostBack="true" OnSelectedIndexChanged="dlStatusChange_SelectedIndexChanged" DataValueField="STATUS_ID" DataTextField="STATUS">
                    </asp:DropDownList>
                  <asp:Button ID="btnStatus" runat="server" Text="Submit" OnClick="btnStatus_Click" />
    		  	
    		  </div><!--close content_container-->
    
               <div class="content_item">
    </div>
            </div>
    
    </div>
    </div>        
    </form>
    </body>
    </html>
    

    Codebehind:

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Data;
    using System.Data.SqlClient;
    using System.Configuration;
    
    namespace CWTS
    {
        public partial class viewTicket : System.Web.UI.Page
        {
            private DataClasses1DataContext db = new DataClasses1DataContext();
            public VIEW_WT_HEADER ticket;
            public VIEW_WT_EVENT events;
            protected void Page_Load(object sender, EventArgs e)
            {
                if (!IsPostBack)
                {
                    DataSet DS = GetData("ticketActionID", null);
                    dlActionChange.DataSource = DS;
                    dlActionChange.DataBind();
    
                    DataSet DS2 = GetData("ticketGetStatus", null);
                    dlStatusChange.DataSource = DS2;
                    dlStatusChange.DataBind();
                    
                    ListItem liAction = new ListItem("Update Action", "-1");
                    dlActionChange.Items.Insert(0, liAction);
    
                    ListItem liStatus = new ListItem("Update Status", "-1");
                    dlStatusChange.Items.Insert(0, liStatus);
    
                    btnAction.Enabled = false;
                    btnStatus.Enabled = false;
                    
                    
                }
    
                if (!String.IsNullOrEmpty(Request.QueryString["TICKET_ID"]))
                {
                    if (db.VIEW_WT_HEADERs.FirstOrDefault(p => p.TICKET_ID.ToString() == Request.QueryString["TICKET_ID"]) != null)
                    {
                        ticket = db.VIEW_WT_HEADERs.FirstOrDefault(p => p.TICKET_ID.ToString() == Request.QueryString["TICKET_ID"]);
                    }
                    else Response.Redirect("searchTicket.aspx");
    
                }
                else Response.Redirect("searchTicket.aspx");
            }
    
            private DataSet GetData(string ticketSearch, SqlParameter ticketParameter)
            {
                string CS = ConfigurationManager.ConnectionStrings["RADIO_INVConnectionString"].ConnectionString;
                SqlConnection con = new SqlConnection(CS);
                SqlDataAdapter da = new SqlDataAdapter(ticketSearch, con);
                da.SelectCommand.CommandType = CommandType.StoredProcedure;
                if (ticketParameter != null)
                {
                    da.SelectCommand.Parameters.Add(ticketParameter);
                }
    
    
                DataSet DS = new DataSet();
                da.Fill(DS);
    
                return DS;
    
            }
            
            protected void dlActionChange_SelectedIndexChanged(object sender, EventArgs e)
            {
                if (dlActionChange.SelectedIndex == 0)
                {
                    btnAction.Enabled = false;
                }
                else
                {
                    btnAction.Enabled = true;
                }  
            }
    
            protected void btnAction_Click(object sender, EventArgs e)
            {
                DataClasses1DataContext db = new DataClasses1DataContext();
    
                int ticketID;
                if (int.TryParse(Request.QueryString["TICKET_ID"], out ticketID))
                {
                    var actionupdate = from act in db.WT_GLOBALs
                                       where act.TICKET_ID == ticketID
                                       select act;
                    foreach (WT_GLOBAL act in actionupdate)
                    {
                        act.ACTION_ID = Convert.ToInt32(dlActionChange.SelectedValue);
                    }
    
                    try
                    {
                        db.SubmitChanges();
                    }
                    catch (Exception r)
                    {
                        Console.WriteLine(r);
                        // Provide for exceptions.
                    }
                    Response.Write(Request.RawUrl.ToString());
    
    
                }
            }
            
            protected void dlStatusChange_SelectedIndexChanged(object sender, EventArgs e)
            {
                if (dlStatusChange.SelectedIndex == 0)
                {
                    btnStatus.Enabled = false;
                }
                else
                {
                    btnStatus.Enabled = true;
    
                }
            }
    
            protected void btnStatus_Click(object sender, EventArgs e)
            {
                DataClasses1DataContext db = new DataClasses1DataContext();
    
                int ticketID;
                if (int.TryParse(Request.QueryString["TICKET_ID"], out ticketID))
                {
                    var statusupdate = from sta in db.WT_GLOBALs
                                           where sta.TICKET_ID == ticketID
                                           select sta;
                    foreach (WT_GLOBAL sta in statusupdate)
                    {
                        sta.STATUS_ID = Convert.ToInt32(dlStatusChange.SelectedValue);
                    }
    
                    try 
                    {
                        db.SubmitChanges();
                    }
                    catch (Exception r)
                    {
                        Console.WriteLine(r);
                        // Provide for exceptions.
                    }
    
                                           
                }
    
            }
    
            protected void btnEvent_Click(object sender, EventArgs e)
            {
                pEventExtender.Show();
            }
        }
    }

    Tuesday, May 5, 2015 3:52 PM
  • User2103319870 posted

    //<script type="text/javascript" src="Scripts/jquery.min.js"></script> //<script type="text/javascript" src="Scripts/image_slide.js"></script>

    Thats not the right way to comment out the codes. Try commenting out like given below

      <%--<script type="text/javascript" src="Scripts/jquery.min.js"></script>--%>
           <%-- <script type="text/javascript" src="Scripts/image_slide.js"></script>--%>

    Also try to create a modal popup in fresh page and see it its work for you.

    Tuesday, May 5, 2015 4:14 PM
  • User607275339 posted

    Ok, thanks for the tip.  I tried commenting it out properly and it didn't work.

    Then I tried creating a new page.  Same thing, no build errors but the button does nothing.

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="CWTS.WebForm1" %>
    <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
    <!DOCTYPE html>
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
                     <ajaxToolkit:toolkitscriptmanager runat="server"></ajaxToolkit:toolkitscriptmanager>
        <div>
                        <asp:Button ID="btnEvent" runat="server" Text="Add Event" OnClick="btnEvent_Click" />
                     <asp:Panel ID="pEvent" runat="server" Style="display: none" CssClass="modalPopup">
                         <asp:Panel ID="Panel1" runat="server" style="border:solid 2px #cccccc; width:98%; cursor: move;">Drag Panel</asp:Panel>
                         <div>Test
                         <asp:Button ID="btnEventSubmit" runat="server" Text="Submit" /><asp:Button ID="btnEventCancel" runat="server" Text="Cancel" />
                        </div>
                             </asp:Panel>
               <ajaxToolkit:ModalPopupExtender ID="pEventExtender" DropShadow="true" PopupDragHandleControlID="Panel1" runat="server" 
                            BackgroundCssClass="modalBackground" CancelControlID="btnEventCancel" 
                            OkControlID="btnEventSubmit" PopupControlID="pEvent" TargetControlID="btnEvent" />
        </div>
        </form>
    </body>
    </html>
    
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    
    namespace CWTS
    {
        public partial class WebForm1 : System.Web.UI.Page
        {
            protected void Page_Load(object sender, EventArgs e)
            {
    
            }
            protected void btnEvent_Click(object sender, EventArgs e)
            {
                pEventExtender.Show();
            }
        }
    }

    Maybe I should restart my computer...


    Tuesday, May 5, 2015 4:34 PM
  • User1644755831 posted

    Hello nmenforcer,

    Your code seems to work fine. Using the latest AjaxToolKit V15.1  http://ajaxcontroltoolkit.codeplex.com/ I tested it and it works fine.

    1. Download the latest version and install it.

    2. Create new project and create new web form page. you should see a section in the Toolbox for AjaxControlToolKit 15.1

    3. Drag and drop ModalPopupExtender to the page it will automatically add the dependent dlls to the reference.

    4. Drag and drop Script Manager from Ajax Extensions to the page. ToolkitScriptManager is Removed in v15.1 so you will need to use Script Manager see

    http://ajaxcontroltoolkit.codeplex.com/wikipage?title=ToolkitScriptManager%20Removed%20in%20v15.1%2c%20Use%20ScriptManager&referringTitle=Documentation

    5. put other controls and run the website it should work.

    Here is the code I used.

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm20.aspx.cs" Inherits="WebFormsIdentity.WebForm20" %>
    
    <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
    
    <!DOCTYPE html>
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
      <title></title>
    </head>
    <body>
      <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        <div>
          <asp:Button
            ID="btnEvent"
            runat="server"
            Text="Add Event"
            OnClick="btnEvent_Click" />
          <asp:Panel
            ID="pEvent"
            runat="server"
            Style="display: none"
            CssClass="modalPopup">
            <asp:Panel
              ID="Panel1"
              runat="server"
              Style="border: solid 2px #cccccc; width: 98%; cursor: move;">
              Drag Panel
            </asp:Panel>
            <div>
              Test
            <asp:Button
              ID="btnEventSubmit"
              runat="server"
              Text="Submit" />
              <asp:Button
                ID="btnEventCancel"
                runat="server"
                Text="Cancel" />
            </div>
          </asp:Panel>
          <cc1:ModalPopupExtender
            runat="server"
            ID="pEventExtender"
            DropShadow="true"
            PopupDragHandleControlID="Panel1"
            BackgroundCssClass="modalBackground"
            CancelControlID="btnEventCancel"
            OkControlID="btnEventSubmit"
            PopupControlID="pEvent"
            TargetControlID="btnEvent">
          </cc1:ModalPopupExtender>
        </div>
      </form>
    </body>
    </html>
    

    Code Behind

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    
    namespace WebFormsIdentity
    {
      public partial class WebForm20 : System.Web.UI.Page
      {
        protected void Page_Load(object sender, EventArgs e)
        {
    
        }
    
        protected void btnEvent_Click(object sender, EventArgs e)
        {
          pEventExtender.Show();
        }
      }
    }

    Hope this helps.

    With Regards,

    Krunal Parekh

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, May 7, 2015 3:16 AM
  • User607275339 posted

    Thanks for the reply.  I think I am perhaps installing the AjaxControlToolkit wrong.  I will try with the latest and see what happens.  I used the Package Manager and also tried adding the reference.  Should I be getting the installer and not just the binary?

    Thursday, May 7, 2015 10:22 AM
  • User607275339 posted

    I give up.  I try to install AjaxControlTooklit.Installer.exe and it tells me the installer has stopped working.  I went through this all before, which is perhaps why it isn't working.  I originally had Visual Studio 2010 that I got from work, but decided to upgrade to 2013.  I think I will clean up my computer and get rid of the 2010 install, but instead of just installing as 1 program, it installs as 30 and I have no idea which ones I need or not.  So frustrating.  I love and hate .NET...

    Thursday, May 7, 2015 10:40 AM
  • User2103319870 posted

    Should I be getting the installer and not just the binary?

    AFAIK DevExpress Team maintains the AjaxControlToolkit now.Recently they introduced a installer for AjaxControlToolkit. You can take a look the below links for more details

    https://www.devexpress.com/Products/AJAX-Control-Toolkit/?utm_source=CodePlex&utm_medium=DevExpressPage&utm_campaign=AjaxControlToolkit&utm_content=AjaxControlToolkit_CodePlex_DevExpressPage

    https://ajaxcontroltoolkit.codeplex.com/releases/view/612416

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, May 7, 2015 10:44 AM