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

  • SEARCH
  • Home
  • 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 6631847
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T22:36:14+00:00 2026-05-25T22:36:14+00:00

I have a scenario where the WCF returns the follwing data ( in the

  • 0

I have a scenario where the WCF returns the follwing data ( in the function given below) to a VIEW.

private List<KeyDatesCalendar> GetKeyDatesCalendarData()
    {
        //Dummy Data for BrandsCalendar CheckList
        var keyDatesCalendar = new List<KeyDatesCalendar>()
        {     

            new KeyDatesCalendar()
            { 
                EventText = "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", 
                EventDate = new DateTime(2011, 02, 09), 
                EventType = 3
            },

            new KeyDatesCalendar()
            { 
                EventText = "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", 
                EventDate = new DateTime(2011, 03, 05), 
                EventType = 3
            },

            new KeyDatesCalendar()
            { 
                EventText = "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", 
                EventDate = new DateTime(2011, 03, 06), 
                EventType = 4
            },

};

The processing of the data in view is done by the following code:

initCalendars({
    from       : '02/01/2011',
    to         : '01/31/2013',
    dates : [
        @for(int i=0, l=@Model.KeyDatesCalendar.Count; i<l; i++)
        {
            @Html.Raw("['" + @Model.KeyDatesCalendar[i].EventDate.ToString("yyyy/MM/dd") + "'," + @Model.KeyDatesCalendar[i].EventType + ",'" + @Model.KeyDatesCalendar[i].EventText + "']" + (i < (l-1) ? "," : ""));
        }
    ]
});

Instead of the hardcoded values in WCF method, how Do i recieve a JSON output and process the same in View.

I am a beginner here, appreciate your detail answers.

Thanks,
Adarsh

  • 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-25T22:36:15+00:00Added an answer on May 25, 2026 at 10:36 pm

    I would agree with many of the previous comments, if you’re using ASP.NET MVC you might as well do the JSON conversion from there (have a look at JsonResult class). However, if you really want the WCF service to return the result in JSON format, this blog post I wrote a while back might help.

    Iain

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

Sidebar

Related Questions

I have a problem of WCF definition of MessageContact and client calling function. Scenario;
I have a scenario where my WCF service is hosted but should return different
I have scenario where I need to host a web service (WCF) on Azure
Scenario I have two WCF Services combined in a single App.Config file. I can't
Scenario I have a windows forms application. I want to use two different WCF
Here is the scenario, I have a WCF service call that takes one string
Hi here is what I what I have: Scenario Outline: Seatching for stuff Given
I have a WCF SOAP 1.1 Webservice with the configuration specified below. A concurrent
I have a scenario where I need to send a series of data across
Imagine this scenario: you have a WCF web service that gets hit up to

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.