AJAX with PageMethods works in Application Pages but not with PageLayouts

Hi All,
I have created a class which contains public static method decorated with WebMethod and SciptMethod attributes
Public class BasePage : Microsoft.SharePoint.Publishing.PublishingLayoutPage
        [WebMethod(EnableSession = true)]
        [ScriptMethod(ResponseFormat = ResponseFormat.Json, UseHttpGet = false)]
        public static string HelloWorld()
            return "Hello world is working!";
Now I changed the <%Page ..> Tag of the PageLayout to inherit from the above class.
There is a ScriptManager in the master page with EnablePageMethods = true
I can see the Javascript methods are generated for HelloWorld(..) however the return result is "The Server Method HelloWorld failed." Error code is 500
However the exact same code when I use with a application page (_layouts) and change the Page tag to inherit from the same base class above - it works OK.
Both of them Page Layout and Application Page use the same master page - but one works and other does not.
Additional Information:
a) Am using Jquery and JqueryUI in the master page.
b) Site use Publishing Template
c) Variation is enabled on site
d) Site has both Anonymous and Windows NT authentication
The method Path for Application page shows as
/_layouts/test.aspx/HelloWorld
and for the page created using the Page layout is:
/en-us/Company/Pages/Default.aspx/HelloWorld.
Could anyone please advise what could be wrong where it does not work with Publishing Pages?
Would please appreciate ideas / thoughts.
Thanks,
Mohan
-- Mohan | My Blog

Are you sure that you are getting HTTP 500 error ?. Usually HTTP 500 error denotes service unavailable at the server side or at the server end point. What is the exact fiddler trace you are getting ?
If it is still HTTP 500, then one of the referenced components in the page layouts conflicts the ajax page methods call. Please let me know your findings
Please mark the replies as answers if they help or unmark if not.

Similar Messages

  • Podcast - works on iTunes page but not when subscribed

    Hi, I produced my podcast, submitted the feed through iTunes store and was validated. However, it happens so that people can listen to the podcast on iTunes page but not when they subscribe to it and try to download. error points to URL issues apparently. Help.

    It works perfectly well for me. On subscribing I saw all three episodes and downloaded and played Episode 2 without any problems. The only explanations I can suggest are that either some of your subscribers are having some sort of technical issue at their end: or that your server is intermittently sulking and failing to respond to requests. Try playing the episode from this link a few times on spaced-out occasions and see whether you ever get a failure:
    http://thecricketcouch.com/CouchTalk/CouchTalk-AntSims-SanaKazmi-062611.mp3

  • Includes work on one page, but not another.

    Hello all.
    I made a Spry naviation bar. It works on the orginal page, but when I put it on other pages, the menu bar is there, but the spry functionality is gone.
    I've also had problems with my CSS stylesheet.  I tried putting it in my header include, but it doesn't work on all my pages, but it does work on some.  I've checked the links and they seem to be right as well
    Any tips?
    Gregg

    As a guess, I would say that you are using doc relative paths inside your include files, and the parent page that does not work is in a different directory than those that do work. But like most questions here, without seeing your code we can only guess.

  • Form validation working on one page, but not the other....

    Hope someone can help with this.
    I have a page below with a load of contact forms which all work fine :
    http://www.goodsafariguide.com/judges/judges.php
    I've trued to recreate (admittedly mostly by saving as....) the same functionality here :
    http://www.goodsafariguide.com/awardssite/judges/
    They do work when fulled in correctly, but there's a glitch with the validation.
    Basically when you fill in a form incorrectly, the page reloads, with the form's accordion closed. When you open it up, its showing the ugly looking error at the top of the form.
    Any ideas what's causing it to act like this, as opposed to the way it works in the first link?
    Thanks.

    Iain71 wrote:
    I've trued to recreate (admittedly mostly by saving as....) the same functionality here :
    http://www.goodsafariguide.com/awardssite/judges/
    They do work when fulled in correctly, but there's a glitch with the validation.
    When looking at the source code I note that - unlike the first page - this one doesn´t contain any references to the ADDT form validation libraries ("../includes/tng/scripts/FormValidation.js" and "../includes/tng/scripts/FormValidation.js.php"), meaning that the validation can´t work.
    Cheers,
    Günter

  • ScriptLink tag not working for application page sharepoint 2010

    <ScriptLink> tag not working for application page sharepoint 2010 for including javascript in application page, it appends either 1033 or _layout to path specified for javascript.But javascripts are located in custom document library on site and not
    in _layouts folder.
    Please help and explain in details as I tried lot on this.

    Hi,
    Use the following line of code
    <SharePoint:Scriptlink runat="server" Name="~sitecollection/Style Library/[YOUR SITE]/js/functions.js" Language="javascript" />
    Thanks,
    Vivek
    Please vote or mark your question answered, if my reply helps you

  • When I send an email with bcc recipients, the bcc does not show in my sent mail so I can't reference back later who I sent the email to. Worked in Snow Leopard but not in Yosemite. Please advise if their is fix for that.

    When I send an email with bcc recipients, the bcc does not show in my sent mail so I can't reference back later who I sent the email to. Worked in Snow Leopard but not in Yosemite. Please advise if their is fix for that.

    Did you select View->Bcc Address Field from the menu bar?

  • After downloading the new lion os x 10.7.2 with cloud and lion recovery update my internet doesnt work. I have tried 2 different networks that work for other people but not me. help?

    After downloading the new lion os x 10.7.2 with cloud and lion recovery update my internet doesnt work. I have tried 2 different networks that work for other people but not me. help?

    Logic's preference files may have become corrupted:
    1. Quit Logic Pro
    2. In the Finder, press and hold down the "option" key then select "Library" from the "Go" menu
    3. Open the "Preferences" folder
    4. Drag the following files to the Trash:
        - com.apple.logic.pro.cs
        - com.apple.logic.pro.LSSharedFileList.plist
        - com.apple.logic.pro.LSSharedFileList.plist.lockfile
        - com.apple.logic.pro.plist
        - com.apple.logic.pro.plist.lockfile
    These files will be re-created when Logic is next opened.

  • Edge Animate file working on main blog page but not on the individual blog post in BC

    I recently uploaded an edge animate file to my blog which is host on Business Catalyst (BC). The edge file works on the main blog page but not on the individual blog post. How can I solve this problem?
    I did the following steps:
    I added the required Adobe Edge scripts on my main blog template.
    Create folder on the server called "edge_includes" and uploaded the 'edge.5.0.0.min' file.
    Create folder on the server called "js" and uploaded the 'jquery-1.7.1.min' file.
    Copy and pasted the div to the part of the blog post I wanted the file to appear (<div id="Stage" class="EDGE-13973370"></div>).
    Uploaded the name of the js file to the root called 'World of Code_edge.'
    Uploaded the images to the existing folder called 'images.'

    I'm still unable to figure out the problem.
    Here is the link to the blog: http://goo.gl/sPW62j (the post titled "Basic Computer Science is a Fundamental Skill in the 21st Century Society").
    Here is the link to the individual post: http://goo.gl/jTSgZH
    Also, I get mixed results on the main blog page. Sometimes the image (Edge Animate file) on the main page shows and other times it does not. However, the image never shows on the individual blog post.

  • Trouble playing .swf - works offline in browser but not online on website

    Hi there,
    I'm having trouble displaying a flash .swf file properly on my website: http://dreamriderproductions.com/fun/game-test/
    When I view the .swf file locally on Chrome, I get a text box to enter my name and I can click Go and keep playing the game. For some reason, when it's up on the website, there's no text box so I can't progress. Can you?
    Background: The game did used to connect to a database, but the upgrade of our website (and relocation of the swf) seems to have broken the database connection. People couldn't progress past the first screen presumable because the information on which city they were in couldn't be submitted to the database. We've got a version of the game with the database connection disabled and so the game should now work - it works locally for me but not on the website!
    Any ideas?
    Thanks
    Sion

    The code you have posted is not the same code as used in:
    <div id="gallery">
    in the link above.
    The reason that the Flash is not displaying in FF is that the portion of the code used by FF was omitted. The code currently used on the page only works in IE.
    I'm no great fan of the IE conditional statements used in the code you posted so I don't blame you for not using it. But you do need to provide something for FF.... the old, out dated method would be to add and <embed> for FF... here's the newer method..
    So either use code you posted above or better yet, get rid of that and replace the current <object> with
    <div id="gallery">
    <object id="FlashID" data="flash/201.swf" type="application/x-shockwave-flash" width="958" height="242">
       <param name="movie" value="flash/201.swf">
       <param name="quality" value="high" />
         <param name="wmode" value="opaque" />
         <param name="swfversion" value="6.0.65.0"/>
    </object>
    </div>
    Give that a try. Will work in both FF and newer IE versions.
    Best wishes,
    Adninjastrator

  • How do I troubleshoot installation/distribution of a LabVIEW .exe which processes data using Matlab when it works on some computers but not others?

    I've been given the unenviable task of troubleshooting and installing/distributing software written by a former co-worker. I've modified the LabVIEW code and built an .exe file. I've successfully installed the Labview .exe file on several computers, but it won't work on some others. What's more baffling is that I installed it successfully on one computer, uninstalled it, and tried reinstalling it with no success. In fact, it's a new error (Dr. Watson for Windows NT application error). It doesn't help that I have different versions of LabVIEW and Matlab on the target computers. Some have LabVIEW 5.1, some
    have 5.0, and some don't have it at all. Some have Matlab 5.2, some have 5.3 (R11) and some have 6.0 (R12). It's also not clear to me where the Matlab m files should be located. I'm not sure if it's a LabVIEW Runtime Engine problem, or if it's a Matlab problem. I've also wondered how LabVIEW and Matlab talk to each other. When LabVIEW calls Matlab, it seems that Matlab is running in the background. In other words, clicking on the Matlab Command Window and typing "whos" or any other command/variable doesn't work.

    Jay del Rosario wrote:
    >
    > How do I troubleshoot installation/distribution of a LabVIEW .exe
    > which processes data using Matlab when it works on some computers but
    > not others?
    Poke around zone.ni.com and
    http://digital.natinst.com/public.nsf/$$Search/ .
    Good luck, Mark

  • Site works in the app, but not in the browser.

    Hello iWeb experts,
    I've got problems.
    Last night I published my site. And while it appears, and functions, properly in my iWeb app, it doesn't do the same in Safari, Firefox, and Internet Explorer.
    Two issues...
    FONTS
    I chose Bellamie, Univers Condensed, and Marydale as my fonts. From reading these forums, I've discovered those won't wysiwyg on other computers if the fonts aren't available and open on them. So my two choices are to make every bit of text a graphic or to use a set of more universal fonts, correct? So my questions are...One, is there a list somewhere of fonts that will work in any browser? And, two, is there a short-cut, or easy way to transform type into a graphic without having to create image files?
    FUNCTIONS
    Here are the functions that work fine in iWeb but have gone haywire in all of the browsers I tested...
    • The type in one nav link appears smaller than all the rest.
    • Some links are active, others are not.
    • Rollover highlighting works on some links, but not others.
    • Most of the rollover links appear in the proper static color, a few do not.
    I've tested these functions on three Macs, one PC, and in the three browsers mentioned above. All of them show the exact same problems. So something must be going wrong with iWebs coding, or my host server musn't like iWeb.
    Any thoughts, suggestions on these two issues? Thanks much for any advice.
    John
    PS - For reference, see: www.johnrunk.com

    Fascinating, Kirk (+he types with one raised eyebrow+).
    QuickTimeKirk wrote:
    When I drag across your page most of your links do not change. The "text" portion of them doesn't change, either. Something is covering them.
    I can see that. But for the life of me, I don't know what could be covering those links. In my app, when I click in the area of the links, the type is the first item selected. Unless, possibly, it could somehow be the faint reflection of my black-and-white image (me & the ground I stand on). Hmmm...
    QuickTimeKirk wrote:
    Single click (outside the boundaries of your page contents) and an "outline" will appear. It shows the image file dimensions and locations.
    This I don't see. An outline? As in "an object outline," or as in "a list of dimensions and locations?" When I click outside my page contents, I get nothing.
    Thanks, QTK. I truly appreciate your troubleshooting here.
    John

  • The scroll function on my mousepad is disabled when viewing a pdf file in firefox version 5.0. The scroll works on the pdf, but not on the other tabs. When the pdf is closed, the scroll function returns to normal. Any ideas?!

    The scroll function on my mousepad is disabled when viewing a pdf file in firefox version 5.0. The scroll works on the pdf, but not on the other tabs. When the pdf is closed, the scroll function returns to normal. Any ideas?!

    Hey thanx for the help, it worked like a charm.
    I think firefox changed the application lay out, as I used to be able to choose my PDF opener from the list at " Adobe Acrobat Forms Document' where I could choose Nitro-PDF reader, but it has now moved all the way to the bottom like you suggested to the obvious place of "Portable Document Format" section.
    If someone didn't tell me , I wouldn't have scrolled all the way down to be able to find it... it really should be with all its cousins up the top...
    Cheers again..

  • Fixed headers while scrolling works fine in bids but not when deployed to reportserver

    Hi, I am using SQL Server 2008 R2 & deploying a report to reportserver with fixed headers while scrolling, this works fine in bids but not when deployed to reportserver. We are IE 9.
    Thanks in advance...............
    Ione

    Hi ione721,
    Since you have identified the 2 xml files are identical, according to my knowledge, there maybe a compatibility issue with IE 9 and SSRS 2008 R2, so I suggest that you could run the report in compatibility mode. Please make sure you have turned on Compatibility
    View in Internet Explorer 9 by following steps:
    When Internet Explorer recognizes that a webpage is not compatible, you will see the Compatibility View button on the Address bar. Try clicking it.
    When Compatibility View is turned on, the button changes from an outline to a solid color when you view the page.
    The following screenshots are for your reference:
    If you have any questions, please feel free to let me know.
    Best Regards,
    Wendy Fu

  • HP Pavilion 15-p027ne, Audio working through headphones/earphones but not through speakers

    HP Pavilion 15-p027ne:
    Audio working through headphones/earphones but not through speakers.
    I downgraded from windows 8.1 to Windows 7 (64-bit) and the problem is still not resolved. 
    Appreciate any troubleshooting tips.
    Thanks.
    - HP Pavilion User.

    Hi there @donimuha 
    Welcome to the HP Support Forums! It is a great place to find the help you need, both from other users, HP experts and other support personnel.
    I understand that you are getting sound from the headphones/earplugs but not from the system speakers. I am happy to assist you with this.
    As the sound is working through the audio jack, I will assume for now that the audio driver is fine. Please check through the following page, which is very comprehensive. If you are still having a problem it is possibly a hardware issue with the speakers.
    No Sound from the Speakers (Windows 7)
    Let me know if that works for you.
    Malygris1
    I work on behalf of HP
    Please click Accept as Solution if you feel my post solved your issue, it will help others find the solution.
    Click Kudos Thumbs Up on the right to say “Thanks” for helping!

  • Hey guyys .if some 1 from firefox team can help it wud be great......I was using firefox 3.6.3 on Mac OS 10.5.8 and Today I installed firefox 3.0(besides application folder) but not in same application folder like firefox 3.6.3 ...so now i had 2 firefox v

    hey guyys .if some 1 from firefox team can help it wud be great......I was using firefox 3.6.3 on Mac OS 10.5.8 and Today I installed firefox 3.0(besides application folder) but not in same application folder like firefox 3.6.3 ...so now i had 2 firefox version 3.6.3 and 3.0....I had 3.6.3 already open ..i closed it to... open 3.0 ....when i opened 3.0 it asked me to import settings i said no....it opened well.....then i close 3.0 and tried to open 3.6.3 version ...now it was a problem everything got lost sessions, bookmarks, add ons, etc....it went back to default ....when i had 2 profiles in 3.6.3.....can any pls help me on dis 1...is there a way to restore my sessions, bookmarks and add ons ??? I have uninstalled 3.0 version now....??? pls pls pls ....help
    == This happened ==
    Just once or twice
    == today

    It turns out that the problem had to do with network accounts, even though it was not clear at first.  Redirecting the program to the local machine's cache with a network home redirector script fixed the issue.  Thanks anyway.

Maybe you are looking for