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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T00:32:13+00:00 2026-06-09T00:32:13+00:00

I am trying to pass a strongly types my Model from view to Controller.

  • 0

I am trying to pass a strongly types my Model from view to Controller. My view is strongly typed. Somehow i am getting “null” in the property values when the “Save” action method is called in the controller. I am using Asp.Net MVC 3.

This is how my View looks like:

@model MvcApplication2.Models.Event
@{
    Layout = null;
}
<!DOCTYPE html>
<html>
<head>
    <title>AddNew</title>
</head>
<body>
    @using(Html.BeginForm("Save","Event",FormMethod.Post, Model))
    {
        <div>
            <p>@Html.LabelFor(m=>m.EventName) @Html.TextBoxFor(m=>m.EventName)</p>
            <p>@Html.LabelFor(m=>m.Venue) @Html.TextBoxFor(m=>m.Venue)</p>
            <p>@Html.LabelFor(m=>m.StartTime) @Html.TextBoxFor(m=>m.StartTime)</p>
            <p>@Html.LabelFor(m=>m.EndTime) @Html.TextBoxFor(m=>m.EndTime)</p>
            @Html.ActionLink("Save Event", "Save")
        </div>
        }
</body>
</html>

This is how my EventController looks like:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using MvcApplication2.Models;

namespace MvcApplication2.Controllers
{
    public class EventController : Controller
    {

        public string Save(Event eventModel)
        {
           //Here eventModel.EventName and rest of the properties are null.

            return "Saved";
        }

    }
}

This is how Model looks like:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace MvcApplication2.Models
{
    public class Event
    {
        public string EventName { get; set; }
        public string Venue { get; set; }
        public string StartTime { get; set; }
        public string EndTime { get; set; }
    }
}
  • 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-09T00:32:15+00:00Added an answer on June 9, 2026 at 12:32 am

    ActionLinks don’t submit forms. Change:

    @Html.ActionLink("Save Event", "Save")
    

    To

    <input type="submit" value="Save">
    

    Additionally, this would have been more pronounced if you added [HttpPost] to your method.

        [HttpPost]
        public string Save(Event eventModel)
        {
           //Here eventModel.EventName and rest of the properties are null.
    
            return "Saved";
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Iam trying to pass dynamic argument values i.e username from request using spring ioc.But
Im trying to pass some values into a text box from a child page
I'm trying to pass a ViewData object from a master page to a view
im trying to pass a generated choices to my model field, please where is
I am trying to pass the fullcalendar events to my controller via Json, however
I am trying to pass a simple JSON object to a controller using MVC3
I'm trying pass in a url as a paramter to my controller like this:
AFAIK, there are two ways of passing data to the view from controller :
Im trying to pass some variables from the URL to the PHP script. Now
im trying to pass back from a user control a list of strings that

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.