Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Jquery call to SharePoint Content Page method

  Asked By: Brandon    Date: Feb 06    Category: Sharepoint    Views: 2942

I am using a SharePoint publishing page layout. There is a link on a page and when someone clicks on the link it should call a page method. I want to achieve this using JQuery so that the page does not get refreshed.
I have tried the following things -
1. Created an aspx page where i declared a Static WebMethod in .cs file & on click of the link i am calling this method using JQuery. This approach worked fine with ASP.Net. But when i tried the same with SP Content Page it did not work.
2. Created a .ascx User Control which contained the method & called the method from JQuery, but it did not work.



1 Answer Found

Answer #1    Answered By: Cassandra Cooper     Answered On: Feb 06

I don't think you can call  a method  in a c# code from page  layout, unless you have the code-behind for the page layout. It look like you want to call a method present in the application page, from jquery  embeeded inside page layout. I don't think it is feasible. Just create a web service and expose the function as web method, so that you can call this readily

Didn't find what you were looking for? Find more on Jquery call to SharePoint Content Page method Or get search suggestion and latest updates.