Home > DeveloperSection > Forums > Page method is returning content of whole page
lois waisbrooker
lois waisbrooker

Total Post:70

Points:494
Posted on    January-16-2015 10:27 PM

 ASP.Net .NET  JavaScript  Azure Mobile Services 
Ratings:


 1 Reply(s)
 538  View(s)
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."



Elena Glibart
Elena Glibart

Total Post:35

Points:128
Posted on    January-16-2015 10:57 PM

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


Don't want to miss updates? Please click the below button!

Follow MindStick