Page method is returning content of whole page

Total Post:70

Points:494
 1092  View(s)
Ratings:
Rate this:

My page method is returning whole page insted of result from the server side. In my local environment it is working fine but when I deploy it to azure I am getting this problem.

My code is:

function LoadLogsOnSucceeded(result) {
    document.getElementById('divHistoryHeader').innerHTML = result.Header;
    document.getElementById("divHistoryList").innerHTML = result.List;

function LoadLogs() {
    var searchTxt = $("#txtLogsearch").val();
    var maxRecords = $('select[id=drplogSearchMaxRecords]').val(); 
    PageMethods.LoadLogs(searchTxt, maxRecords, LoadLogsOnSucceeded, OnFailed);
}

In config I have not added

<httpModules>

  <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

</httpModules>

when I add that into my config then in local also project is not working getting error like

"The page cannot be displayed because an internal server error has occurred."

  1. Post:42

    Points:296
    Re: Page method is returning content of whole page

    I got the solutions some configurations were missing in web.config I added

    <httpModules>
      <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
    </httpModules>  
      <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
          <dependentAssembly>
            <assemblyIdentity name="WebGrease" culture="neutral" publicKeyToken="31bf3856ad364e35" />
            <bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="Microsoft.WindowsAzure.ServiceRuntime" publicKeyToken="31bf3856ad364e35" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-2.3.0.0" newVersion="2.2.0.0" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="Microsoft.WindowsAzure.Storage" publicKeyToken="31bf3856ad364e35" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-2.1.0.0" newVersion="2.1.0.0" />
          </dependentAssembly>
        </assemblyBinding>
      </runtime>

    and now it is working fine

      Modified On Apr-07-2018 07:03:36 AM

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!