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 7853807
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T19:48:36+00:00 2026-06-02T19:48:36+00:00

I have a JSON function to return the following data and it is what

  • 0

I have a JSON function to return the following data and it is what I expected:

[{"ShowId":1,"Title":"The Forresters Axe","Date":"\/Date(1339714800000)\/","Time":{"Hours":19,"Minutes":0,"Seconds":0,"Milliseconds":0,"Ticks":684000000000,"Days":0,"TotalDays":0.79166666666666663,"TotalHours":19,"TotalMilliseconds":68400000,"TotalMinutes":1140,"TotalSeconds":68400}}]

but when I try to display the Title on the view page I am having problems. This is the view page code:

<table> @foreach (var showList in Model) {<tr><td>@showList.Title</td></tr>}<.table>

This is the ActionResult I have been using but when I got through to the view I could not get the data to display. I used the JSON function as above to double check that I had the right data and was not trying to call something that was not there.

enter/*-------------------------------------------------------
      BOOKING/CHECKAVAIL ACTIONRESULT CALLING CHECKAVAIL VIEW
        Select information from Run table where the id == ShowId

     ------------------------------------------------------*/
    public ActionResult CheckAvail(int id)
    {
        var showList = from r in db.Runs
                       join s in db.Shows on r.ShowId equals s.ShowId
                       where r.ShowId == id
                       select new
                     {
                         ShowId = r.ShowId,
                         Title = s.Title,
                         Date = r.Date,
                         Time = r.Time
                     };
        return View(showList);
    }

The error I get is:

RuntimeBinderException was unhandled by code

‘object’ does not contain a definition for Title

  • 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-06-02T19:48:38+00:00Added an answer on June 2, 2026 at 7:48 pm

    With the expression new { ... } you are creating an anonymous type which is basically not supported to pass in the View method as a Model.

    There are a few workarounds:

    • Anonymous View Models in ASP.NET MVC Using Dynamics
    • Passing anonymous type to ASP.NET MVC’s View

    But the easiest solution is to create a viewmodel which will hold your data:

    public class CheckAvailViewModel
    {
        public int ShowId { get; set; }
        public string Title { get; set; }
        public DateTime Date { get; set; }
        public DateTime Time { get; set; }
    }
    

    And return this from your query:

    var showList = from r in db.Runs
                         // ...
                         select new CheckAvailViewModel
                         {
                             ShowId = r.ShowId,
                             Title = s.Title,
                             Date = r.Date,
                             Time = r.Time
                         };
    return View(showList.ToArray());
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

All, I have the following JSON Data. I need help writing a function in
I have no idea how to properly 'return' this JSON object (in JavaScript): function
I have the following simple jquery snippet $(document).ready(function () { $.ajax({ url:myjson.json, dataType: 'json',
I have the following function: function validateField(query) { new Request.JSON({ onRequest : function() {
I have following json data which I want to pass it to server using
I have the following JQUERY code that I'm expecting to return 3 json results
I have an extremely simple JSON object that looks like the following: var data
The following works, if I have something like this: return Json(new { CustomerInfo =
I have the following code snippet: $.getJSON(http://localhost:8080/images, function(data) { var items = []; $.each(data,
I have the following JSON data being returned by a webservice: {d:[ {RelationshipManager:{},AdvisoryId:13,ClientId:22,UserId:13,AdvisoryMessage:Welcome!,Seen:false,Issued:\/Date(1312123970110)\/,Delivered:null,Importance:3}, {RelationshipManager:{},AdvisoryId:14,ClientId:22,UserId:13,AdvisoryMessage:A

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.