title: ASP.Net PageMethods executes page load event instead of method if I navigate to the page with the Web Method
body: <p>I'm using ASP.Net Ajax through the PageMethods function in Javascript.  This function triggers a method on the server without posting the page back.  If launch the project with this page as the startup then the web function is working as intended.  However, if I navigate away from the page and then navigate back (or start the project with a different page and then navigate to the page in question) then the PageMethods call will run the page load event and not run the web method at any point.</p>
  <p>I have these ASP.Net Ajax PageMethods on my Default.aspx page as well and for some reason this page does not have this issue.  I can navigate away and then come back and everything still works as intended.</p>
  <p>Does anyone know what would cause my other page to execute the page load event and not the web method?</p>
  <p><strong><strong>EDIT</strong></strong>
  Here is a link to an answer on a similar question that worked for me.  However, I'm still curious as to why I would need to run this function in order for the PageMethods to work.</p>
  <p><a href="https://stackoverflow.com/a/40379421/11466855">https://stackoverflow.com/a/40379421/11466855</a></p>
  <p>From what I'm seeing is that when the page first loads this javascript function will check the PageMethods path and if it doesn't have &quot;.aspx&quot; in the path then it appends that value to the end of it and this caused my issue to go away.  I'm curious as to why and what causes the path to not be useable.</p>
  <p>Thank you!</p>