Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 756175
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T15:12:54+00:00 2026-05-14T15:12:54+00:00

$(‘#calendar’).fullCalendar ( { editable: true, events: $.ajax ( { type: POST, url: Calender.aspx/GetCDCatalog, contentType:

  • 0
$('#calendar').fullCalendar
        (

            {
                editable: true,
                events:
                $.ajax
                (
                    {
                        type: "POST",
                        url: "Calender.aspx/GetCDCatalog",
                        contentType: "application/json; charset=utf-8",
                        data: "{}",
                        dataType: "json"
                    }
                )

            }
       )

calender.aspx is page and getcddialog is function which return type is array which doest not bind calender.

public CD[] GetCDCatalog()
{
    XDocument docXML =
    XDocument.Load(Server.MapPath("mydata.xml"));

    var CDs =
      from cd in docXML.Descendants("Table")
      select new CD
      {
          title = cd.Element("title").Value,
          star = cd.Element("star").Value,
          endTime = cd.Element("endTime").Value,

      };
    return CDs.ToArray<CD>();
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T15:12:54+00:00Added an answer on May 14, 2026 at 3:12 pm

    You can’t, to my knowledge call a function on an ASP.NET Webforms page in such a manner. And forgive me, I am making the assumption that this is a Webforms application. If this were an ASP.NET MVC application in which the Calender.aspx [sic] page is a View for the CalenderController you could do something like:

    public JsonResult GetCDCatalog()
    {
        // your logic
        return Json(CDs.ToList<CD>());
    }
    

    More info: Link

    Also, would it be possible to make the GetCDCatalog() method into a web service method? It looks like that’s where you might be headed.

    EDIT: Ok, so I made a little proof of concept that hopefully you’ll be able to adapt to your project/solution.

    I created an ASP.NET Webforms (Visual Studio 2010/Webforms 4) application with the following method on the Default.aspx page:

        [WebMethod]
        public static string[] GetSomeThings(int numberOfThings)
        {
            List<string> strings = new List<string>();
    
            for (int i = 0; i < numberOfThings; ++i)
                strings.Add(i.ToString());
    
            return strings.ToArray<string>();
        }
    

    On the Default.aspx page of my application, I added the following jQuery:

    (NOTE: You’re probably looking to call your Calender.aspx page from a different page, but as long as it is not cross-domain, it should be fine. Otherwise, you’ll need to use JSONP and add a callback=? to the end of the URL to which you’re POSTing).

        function GetSomeThingsUsingJSON() {
            $.ajax({
                url: 'default.aspx/GetSomeThings',
                type: 'POST',
                contentType: 'application/json; charset=utf-8',
                dataType: 'json',
                data: '{ "numberOfThings": 2 }',
                success: OnSuccess,
                error: OnError
            });            
        }
    
        function OnSuccess(data, textStatus, XMLHttpRequest) {
            $("span#json").text("The length of the array returned is " + data.d.length);
        }
    
        function OnError(XMLHttpRequest, textStatus, errorThrown) {
            $("span#json").text("An error occurred - " + textStatus);
        }
    

    Then, I just called GetSomeThingsUsingJSON() on the page load (document.ready). It returns the following JSON:

    {"d":["0","1"]}
    

    I believe the "d" is a .NET convention/annoyance. Regardless, to access the data you want in your OnSuccess method, you’ll need to reference the d property for the array you’re looking for as I do to get the length of the array returned.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The problem with unsigned char. I am reading a PPM image file which has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.