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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:51:35+00:00 2026-05-26T14:51:35+00:00

I’m working on an ASP.NET MVC 3 application and having some issues. I’ve got

  • 0

I’m working on an ASP.NET MVC 3 application and having some issues. I’ve got a PartialView which has a submit button. Code looks something like this:

@using (Html.BeginForm("Edit", "IceCream", FormMethod.Post, new { id = "editicecreamform" + @Model.IceCreamID }))
{
   @Html.EditorFor(model => model.Name)
   @Html.ValidationMessageFor(model => model.Name)
   @Html.TextBoxFor(model => model.FirstDateTime, new { @class = "mydatetime" })
   @Html.ValidationMessageFor(model => model.FirstDateTime)
   @Html.TextBoxFor(model => model.SecondDateTime, new { @class = "mydatetime" })
   @Html.ValidationMessageFor(model => model.FirstDateTime)
   <input type="submit" value="Save" data-icecream="@Model" />
}

and the script portion looks like this:

<script type="text/javascript">
   $('.mydatetime').datetimepicker({
      showSecond: true,
      timeFormat: 'hh:mm:ss TT', 
      hourGrid: 4,
      minuteGrid: 10
   });

   $(document).ready(function () {
      var options = {
         target: "#icecreamdetails@(Model.IceCreamID)",
         url: '@Url.Action("Edit", "IceCream")',
         success: UpdateGrid // not germane to discussion
      };

      $("#editicecreamform@(Model.IceCreamID)").submit(function () {
         $(this).ajaxSubmit(options);
         return false;
      });
   });
</script>

My Edit action looks something like:

[HttpPost]
public PartialViewResult Edit(IceCreamCreateEditViewModel viewModel)
{
   if (ModelState.IsValid)
   {
   }
   return PartialView();
}

The error occurs when I edit an entry and make the Name field blank and try to save it. There’s a [Required] annotation on the property in the viewmodel and so I get the validation error message. However, if I then attempt to click on one of my two datetime edits, I get a “too much recursion” or stackoverflow error. This occurs in FF as well as IE8. The error is in the jquery-ui-datetimepicker-addon.js file that I’m using, which I got from http://trentrichardson.com/2010/04/19/timepicker-addon-for-jquery-ui-datepicker, at least that’s where the debugging tool leads me.

If I just use the jquery datepicker (no time component), I don’t get this error at all.

I assume there could be an error in the datetimepicker but as I’m new to jquery and ASP.NET MVC, there’s a good chance it’s just me not doing something correctly.

Any ideas?

  • 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-26T14:51:36+00:00Added an answer on May 26, 2026 at 2:51 pm

    So, it appears that the problem is that my partial view has this line:

    <script src="@Url.Content("~/scripts/jquery-ui-datetimepicker-addon.js")" type="text/javascript"></script
    

    and if I move that into the _Layout.cshtml instead, it doesn’t get referenced twice and the “too much recursion” / stackoverflow issue.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I've got a string that has curly quotes in it. I'd like to replace
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
Basically, what I'm trying to create is a page of div tags, each has

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.