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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T01:06:43+00:00 2026-05-30T01:06:43+00:00

I am performing an Ajax submit ASP.Net with MVC : @using (Ajax.BeginForm( action, References,

  • 0

I am performing an Ajax submit ASP.Net with MVC:

@using (Ajax.BeginForm(
        action,
        "References",
        null,
        new AjaxOptions
        {
            UpdateTargetId = "update-message",
            InsertionMode = InsertionMode.Replace,
            HttpMethod = "POST",
            OnSuccess = success,
            OnFailure = "ajaxOnFailure"
        }, new { @id = "dialogForm", @class = "ui-widget dialog-admin" }))

Which is converted to:

<form method="post" id="dialogForm" data-ajax-update="#update-message"
 data-ajax-success="menuDialogSuccess('Create Complete','Create')" 
data-ajax-mode="replace" data-ajax-method="POST" 
data-ajax="true" class="ui-widget dialog-admin" 
action="/Administration/Menus/Create" novalidate="novalidate">

This replies with a status 500 web page with the following:

Unable to cast object of type 'System.Int32' to type 'System.String'

I cannot see what field this refers to. Is there some place I can look to track this down?

  • 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-30T01:06:46+00:00Added an answer on May 30, 2026 at 1:06 am

    I found out that the problem is caused by this:

        [StringLength(3, ErrorMessage="Order must be 3 characters")]
        [Range(0, 99, ErrorMessage = "{0} must be between {1} and {2}")]
        [DisplayName("Order")]
        public int Order { get; set; }
    

    The code is trying to get the length of something that is not a string.

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

Sidebar

Related Questions

It appears that both jQuery and ASP.Net MVC have ways of performing AJAX functions.
I am using the ASP.NET Ajax controls UpdatePanel and UpdateProgress. The idea of a
I have been using Anthem.NET in ASP.NET 2.0 projects for a few side projects
I am performing a simple AJAX() request using Jquery (Google hosted 1.7.1 jquery.min.js code)
I have coded some JavaScript to perform an ajax call in an asp.net application.
I am new to using ajax but have been using PHP for awhile. I
I am building an ajax form using the MVC Ajax Helpers: http://msdn.microsoft.com/en-us/library/dd505013.aspx The code
Okay, this is following on from my previous question reguarding performing a simple ajax
Now that most modern browsers support AJAX and client-side requests without performing a POST,
I'm performing a bulk insert with an ADO.NET 2.0 SqlBulkCopy object from a C#

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.