Results 1 to 10 of 10

Thread: AJAX Not Working from One Server to the Next

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2017
    Posts
    14

    AJAX Not Working from One Server to the Next

    Hello,

    I have a page with a basic modal popup. The code is as follows:

    Code:
    <%@ Page Title="" Language="VB" MasterPageFile="~/re.master" AutoEventWireup="false" CodeFile="addproperty.aspx.vb" Inherits="Register_default" %>
    <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
    
    <asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
        <title>Admin - Add Property</title>
        <style>
        .modalBackground{
            background-color:black;
            filter:alpha(opacity=90) !important;
            opacity:0.6 !important;
            z-index:20;
        }
        .modalpopup{
            padding:30px 10px 30px 10px;
            position:relative;
            width:550px;
            height:100px;
            background-color:white;
            border:1px solid black;
        }
        </style>
    </asp:Content>
    <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
        <!--============================== slider =================================-->
        <div class="row_6">
            <div class="container">
                <div class="row">
                    <div class="span8">
                    <h2>Add Property</h2>
                        <div id="contact-form" class="contact-form">
                          <div><asp:Label ID="lblMessage" runat="server" Font-Bold="true" Text=""></asp:Label></div>
                          <fieldset>
                              <div class="coll-1">
                                <p>Address*</p>
                                <label class="address">
                                    <asp:TextBox ID="txtAddress" runat="server" MaxLength="100"></asp:TextBox><br />
                                    <span id="emptyaddress" runat="server" style="color:#f00; font-size:10px; line-height:1.2em; text-align:right; overflow:hidden; width:100%; text-transform:none; position:relative; left:650px; display:none;">*This field is required.</span>
                                </label>
                              </div>
                              <div class="coll-2">
                                <p>City / State*</p>
                                <label class="city">
                                    <asp:TextBox ID="txtCity" runat="server" MaxLength="100"></asp:TextBox>&nbsp;<asp:DropDownList ID="ddlState" runat="server"></asp:DropDownList><br />
                                    <span id="emptycity" runat="server" style="color:#f00; font-size:10px; line-height:1.2em; text-align:right; overflow:hidden; width:100%; text-transform:none; position:relative; left:650px; display:none;">*This field is required.</span>
                                </label>
                              </div>
                              <div class="coll-3">
                                <p>Zip Code*</p>
                                <label class="zipcode">
                                    <asp:TextBox ID="txtZipCode" runat="server" MaxLength="10"></asp:TextBox><br />
                                    <span id="emptyzip" runat="server" style="color:#f00; font-size:10px; line-height:1.2em; text-align:right; overflow:hidden; width:100%; text-transform:none; position:relative; left:650px; display:none;">*This field is required.</span>
                                </label>
                              </div>
                              <div class="clear"></div>
                              <div class="coll-1">
                                <p>Status*</p>
                                <label class="status">
                                    <asp:DropDownList ID="ddlStatus" runat="server"></asp:DropDownList>
                                </label>
                              </div>
                              <div class="clear"></div>
                              <div>
                                  <p>Description</p>
                                  <label class="description">
                                    <asp:TextBox ID="txtDescription" TextMode="MultiLine" runat="server"></asp:TextBox>                                
                                </label>
                              </div>
                              <div class="clear"></div>
                              <div class="buttons-wrapper clearfix"><asp:LinkButton ID="lbSave" Class="btn link2" data-type="submit" runat="server">Save Property</asp:LinkButton><span>*required fields</span></div>
                            </fieldset>
                        </div>
                    </div>
                    <div class="span4">
                        <h2>Menu</h2>
                        <ul class="list2 clearfix">
                            <% ShowAdminSubMenu(Session("AccountTypeID")) %>
                        </ul>
                    </div>
                </div>
            </div>   
        </div>
        <asp:Button ID="Button1" runat="server" style="display:none" Text="" />
        <asp:Panel ID="Panel1" runat="server" CssClass="modalpopup">
            <asp:Label ID="lblmodalMsg" runat="server" Text=""></asp:Label>
            <div style="width:100%; text-align:center"><asp:LinkButton ID="LinkButton2" Class="btn link2" data-type="submit" runat="server">Create Another Work Order</asp:LinkButton>
            <asp:LinkButton ID="LinkButton3" Class="btn link2" data-type="submit" runat="server">Return to Work Orders</asp:LinkButton></div>
        </asp:Panel>
        <ajaxToolkit:ModalPopupExtender ID="ModalPopupExtender1" runat="server" PopupControlID="Panel1" TargetControlID="Button1" BackgroundCssClass="modalBackground"></ajaxToolkit:ModalPopupExtender>
    </asp:Content>
    This code had been working fine for months, however, I recently moved the site to a new host and now the modal popup appears at the bottom of the page. See below:
    Name:  modalpop_err.jpg
Views: 472
Size:  8.4 KB

    The new host claims they support AJAX and have verified for me that AJAX is "enabled" on the server, but clearly there's something different between the 2 hosts? When I transferred my site, they did force me to comment out a number of lines in the web.config file. The web.config now looks like the following:

    Code:
    <?xml version="1.0"?>
    
    <configuration>
        <configSections>
          <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
            <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
              <!--<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>-->
              <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
                <!--<section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere" />-->
                <!--<section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />-->
                <!--<section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />-->
                <!--<section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />-->
              </sectionGroup>
            </sectionGroup>
          </sectionGroup>
        </configSections>
        <appSettings/>
        <connectionStrings>
          <clear/>
          <add name="strDBConnection" connectionString="Data Source=db123456.db.1and1.com; Initial Catalog=db9876543; User ID=dboTEST; Password=SORRY!"/>
        </connectionStrings>
        <system.web>
          <httpRuntime maxRequestLength="1048576" executionTimeout="3600" />
            <!-- 
                Visual Basic options:
                Set strict="true" to disallow all data type conversions 
                where data loss can occur. 
                Set explicit="true" to force declaration of all variables.
            -->
            <compilation debug="true" strict="false" explicit="true">
              <assemblies>
                <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
                <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
              </assemblies>
            </compilation>
            <!--
              The <authentication> section enables configuration 
              of the security authentication mode used by 
              ASP.NET to identify an incoming user. 
            -->
            <authentication mode="Windows" />
            <customErrors mode="Off"/>  
          <!--
               The <customErrors> section enables configuration 
               of what to do if/when an unhandled error occurs 
               during the execution of a request. Specifically, 
               it enables developers to configure html error pages 
               to be displayed in place of a error stack trace.
    
               <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
                 <error statusCode="403" redirect="NoAccess.htm" />
                 <error statusCode="404" redirect="FileNotFound.htm" />
               </customErrors>
            -->
            <pages>
              <namespaces>
                <clear />
                <add namespace="System" />
                <add namespace="System.Collections" />
                <add namespace="System.Collections.Generic" />
                <add namespace="System.Collections.Specialized" />
                <add namespace="System.Configuration" />
                <add namespace="System.Text" />
                <add namespace="System.Text.RegularExpressions" />
                <add namespace="System.Linq" />
                <add namespace="System.Xml.Linq" />
                <add namespace="System.Web" />
                <add namespace="System.Web.Caching" />
                <add namespace="System.Web.SessionState" />
                <add namespace="System.Web.Security" />
                <add namespace="System.Web.Profile" />
                <add namespace="System.Web.UI" />
                <add namespace="System.Web.UI.WebControls" />
                <add namespace="System.Web.UI.WebControls.WebParts" />
                <add namespace="System.Web.UI.HtmlControls" />
              </namespaces>
              <controls>
                <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
                <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
                <!--<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>-->
                <add namespace="AjaxControlToolkit" assembly="AjaxControlToolkit" tagPrefix="ajaxToolkit"/>
              </controls>
            </pages>
          <httpHandlers>
            <remove verb="*" path="*.asmx"/>
            <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
          </httpHandlers>
          <httpModules>
            <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
          </httpModules>
        </system.web>
        <system.codedom>
          <compilers>
            <compiler language="c#;cs;csharp" extension=".cs" warningLevel="4"
                      type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
              <providerOption name="CompilerVersion" value="v3.5"/>
              <providerOption name="WarnAsError" value="false"/>
            </compiler>
            <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" warningLevel="4"
                      type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
              <providerOption name="CompilerVersion" value="v3.5"/>
              <providerOption name="OptionInfer" value="true"/>
              <providerOption name="WarnAsError" value="false"/>
            </compiler>
          </compilers>
        </system.codedom>
        <!-- 
            The system.webServer section is required for running ASP.NET AJAX under Internet
            Information Services 7.0.  It is not necessary for previous version of IIS.
        -->
        <system.webServer>
          <security>
            <requestFiltering>
              <requestLimits maxAllowedContentLength="1073741824" />
            </requestFiltering>
          </security>
          <validation validateIntegratedModeConfiguration="false"/>
          <modules>
            <remove name="ScriptModule" />
            <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
          </modules>
          <handlers>
            <remove name="WebServiceHandlerFactory-Integrated"/>
            <remove name="ScriptHandlerFactory" />
            <remove name="ScriptHandlerFactoryAppServices" />
            <remove name="ScriptResource" />
            <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode"
                 type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode"
                 type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
          </handlers>
          <staticContent>
            <remove fileExtension=".woff" />
            <mimeMap fileExtension=".woff" mimeType="application/font-woff" />
          </staticContent>
          <defaultDocument enabled="true">
            <files>
              <clear/>
              <add value="default.aspx" />
              <add value="index.aspx" />
              <add value="index.html" />
            </files>
          </defaultDocument>
        </system.webServer>
        <runtime>
          <assemblyBinding appliesTo="v2.0.50727" xmlns="urn:schemas-microsoft-com:asm.v1">
            <dependentAssembly>
              <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>
              <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
            </dependentAssembly>
            <dependentAssembly>
              <assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/>
              <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
            </dependentAssembly>
          </assemblyBinding>
        </runtime>
    
    </configuration>
    Any help you can provide as to why AJAX is not working is greatly appreciated!

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,299

    Re: AJAX Not Working from One Server to the Next

    When you say that it appears at the bottom of the page, do you mean it appears when you expect it to but in the wrong place or it appears as soon as the page loads?

  3. #3

    Thread Starter
    New Member
    Join Date
    Jul 2017
    Posts
    14

    Re: AJAX Not Working from One Server to the Next

    Quote Originally Posted by jmcilhinney View Post
    When you say that it appears at the bottom of the page, do you mean it appears when you expect it to but in the wrong place or it appears as soon as the page loads?
    It appears in the bottom-left when the page loads. Those 2 buttons are not supposed to appear until the "save" button is clicked.

  4. #4
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,929

    Re: AJAX Not Working from One Server to the Next

    It seems that the only thing that could hide it in the first place (as you want) is the CssClass="modalpopup" on the panel.

    It seems to me that css class is not referenced at all, as I can't see anything in what you showed that defines it or refers to a css file. It may be that it is supposed to be defined by AjaxControlToolkit somehow, but I haven't used that so I'm only guessing.

  5. #5
    Frenzied Member KGComputers's Avatar
    Join Date
    Dec 2005
    Location
    Cebu, PH
    Posts
    2,020

    Re: AJAX Not Working from One Server to the Next

    Did you test the website locally by commenting/uncommenting those lines in the web.config?

    MSDN ScriptResourceHandler
    CodeBank: VB.NET & C#.NET | ASP.NET
    Programming: C# | VB.NET
    Blogs: Personal | Programming
    Projects: GitHub | jsFiddle
    ___________________________________________________________________________________

    Rating someone's post is a way of saying Thanks...

  6. #6

    Thread Starter
    New Member
    Join Date
    Jul 2017
    Posts
    14

    Re: AJAX Not Working from One Server to the Next

    Quote Originally Posted by si_the_geek View Post
    It seems that the only thing that could hide it in the first place (as you want) is the CssClass="modalpopup" on the panel.

    It seems to me that css class is not referenced at all, as I can't see anything in what you showed that defines it or refers to a css file. It may be that it is supposed to be defined by AjaxControlToolkit somehow, but I haven't used that so I'm only guessing.
    The class is at the top of the .aspx page. Here is the code:
    Code:
    <style>
        .modalBackground{
            background-color:black;
            filter:alpha(opacity=90) !important;
            opacity:0.6 !important;
            z-index:20;
        }
        .modalpopup{
            padding:30px 10px 30px 10px;
            position:relative;
            width:550px;
            height:100px;
            background-color:white;
            border:1px solid black;
        }
        </style>

  7. #7

    Thread Starter
    New Member
    Join Date
    Jul 2017
    Posts
    14

    Re: AJAX Not Working from One Server to the Next

    Quote Originally Posted by KGComputers View Post
    Did you test the website locally by commenting/uncommenting those lines in the web.config?

    MSDN ScriptResourceHandler
    I commented out the web.config lines on the old host and the AJAX still ran fine, so I do not believe it is an issue with the web.config. Essentially I now have 2 identical sets of code on 2 different hosts and one runs and the other does not. The new host is 1&1 and they claim to support AJAX, but clearly they do not. I have the Unlimited Plus Windows package:
    https://www.1and1.com/windows-hosting#top-features

  8. #8
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,929

    Re: AJAX Not Working from One Server to the Next

    Quote Originally Posted by ftbadolato View Post
    The class is at the top of the .aspx page. Here is the code:
    ...
    Ah, so it is... I must have scrolled the code window before checking

    There is nothing in there to hide the panel, but I'm assuming AjaxControlToolkit does that somehow.

    Quote Originally Posted by ftbadolato View Post
    The new host is 1&1 and they claim to support AJAX, but clearly they do not.
    Ajax doesn't necessarily mean AjaxControlToolkit.

    I would recommend making sure that AjaxControlToolkit is installed on the server, but I'm afraid I haven't used it myself so don't know the steps to do that.

  9. #9

    Thread Starter
    New Member
    Join Date
    Jul 2017
    Posts
    14

    Re: AJAX Not Working from One Server to the Next

    Quote Originally Posted by si_the_geek View Post
    Ajax doesn't necessarily mean AjaxControlToolkit.

    I would recommend making sure that AjaxControlToolkit is installed on the server, but I'm afraid I haven't used it myself so don't know the steps to do that.
    For the toolkit, all I believe you need to do is drop the AjaxControlToolkit.dll in the /bin/ folder, which I have done. I literally took the code from one host and copied it to 1&1. I've never had this issue and I've been using this toolkit for years.

  10. #10

    Thread Starter
    New Member
    Join Date
    Jul 2017
    Posts
    14

    Re: AJAX Not Working from One Server to the Next

    Just a heads up, this issue was never resolved. I ended up moving my site to another host. I have determined that 1and1 does NOT support AJAX despite claiming to do so on their Windows hosting packages.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width