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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:17:55+00:00 2026-05-25T11:17:55+00:00

I am having problems passing my model from my view via an Ajax call

  • 0

I am having problems passing my model from my view via an Ajax call to my controller. All of the model properties that have Telerik html ‘For’ controls do not persist in the model. The only way I can access those values in the controller is using Request[“control_name”]. All other standard controls like input type=text serialize just fine. What am I doing wrong?

Here is my ajax call:

function ImportLogFile() {

    $.ajax({
        url: '/Job/ImportLogFile',
        type: 'POST',
        data: $("form").serialize(),
        success: function (data)
        {
            $('body').css('cursor', 'auto');
            alert("Word Counts imported.");
        },
        error: function (xhr, status, error) 
        {
            alert(status + ": " + strip(xhr.responseText).substring(0, 1000) + "...");
        }
    });
}

Controller:

[HttpPost]
public ActionResult ImportLogFile(tblJobTask model)
{
    ...
}

View:

@model viaLanguage.Jams.Data.tblJobTask

<html>
<head></head>
<body>

@using (Html.BeginForm())
{

    <label class="editorLabel">CAT Tool Type:</label>
        @{ Html.Telerik().ComboBoxFor(model => model.CatToolID)
                .Name("JobTask_CatToolID")
                .BindTo(new SelectList((IEnumerable)ViewData["CatTools"], "CatToolID", "Description"))
                .HtmlAttributes(new { style = "width:220px;" });
         }

<input id="btnImport" type="button" onclick="ImportLogFile();"  />

}

</body>
</html>
  • 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-25T11:17:55+00:00Added an answer on May 25, 2026 at 11:17 am

    i believe .Name("JobTask_CatToolID") is the source of problem. when you change Name attribute of combobox to something other than property name it will not automatically bound to the property by modelbinder. ModelBinder just looks at posted keys and then searches for matching properties in model and populates them accordingly. and when binder finds the key JobTask_CatToolID it probably finds no matching property in the model and hence it is not assigned to any property. you can check this by omitting the Name(---) method and then posting data to your controller.

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

Sidebar

Related Questions

Im having problems displaying records to my view when passing viewdata to a user
I am having a problem with views. I have a view and am passing
I'm having problems in passing multiple models to a single view, after reading other
I am having problems with Html.ActionLink when I have a route that takes one
I'm having problems when trying to change the model of my view in MVC
I'm having some problems with Jquery UI Dialog and TinyMCE. Passing data to a
I'm having a problem passing strings that exceed 80 characters in JSON. When I
I have an Event model that includes a start time field, which is stored
Im having problems passing PHP Strings to Javascript functions, I'v read a number of
I'm working with PHPRO's MVC framework and am having problems passing a Registry object

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.