locked
ASP .NET MVC returning cleared form and not submitting RRS feed

  • Question

  • Hi.

    I am supporting a MVC site, developed by a team that is no longer in the company, and users are reporting a strange behaviour, which I am now sometimes able to reproduce.

    All the fields on the form are completed with the correct information, but when submit is clicked, the page refreshes with the fields cleared and nothing seem to have happened. Then, a second or third try works as intended and the information is submitted. If the user is lucky, it might just work the first time.

    Since I am not very familiar with ASP .NET MVC, I first added logs the function that answers the submit button. The first code, when the function is called, logs the milestone so that I would know how far things went. Problem is, on those cases that the form just gets cleared, this log is never recorded, which leads me to believe that the function is not being called at all.

    Is there any intermediate step that might be causing this issue?

    The function, in the controller class, is flagged with two properties, Authorize and HttpPost, but I would not think that those are the problem.

    As a further complication, the site is actually in a load balance environment, spread in 7 different IIS servers. I checked all and the installations/configurations look like to be the same.

    Maybe I am missing something obvious that another pair of eyes will spot easily. Any help is appreciated and feel free to ask for more information.

    Thanks.

    • Moved by Carl Cai Monday, March 10, 2014 2:39 AM (from vb) asp.net forum is more dedicated for these issues
    Monday, March 10, 2014 1:22 AM

Answers

  • Hi,

    Welcome to MSDN.

    I am afraid that this is not the proper forum, since this is a web development issue.

    I would suggest you post this issue in ASP.Net forum for more dedicated supports to solve your issue more efficiently.

    In addition, in order to narrow down this issue more efficiently, I would suggest you share the controller code and the status of that post in that new thread, that will be helpful for communities of that forum to solve your issue.

    Thanks for your understanding.

    Regards.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    • Edited by Carl Cai Monday, March 10, 2014 2:38 AM
    • Marked as answer by Naretto Monday, March 10, 2014 3:32 AM
    Monday, March 10, 2014 2:38 AM

All replies

  • Hi,

    Welcome to MSDN.

    I am afraid that this is not the proper forum, since this is a web development issue.

    I would suggest you post this issue in ASP.Net forum for more dedicated supports to solve your issue more efficiently.

    In addition, in order to narrow down this issue more efficiently, I would suggest you share the controller code and the status of that post in that new thread, that will be helpful for communities of that forum to solve your issue.

    Thanks for your understanding.

    Regards.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    • Edited by Carl Cai Monday, March 10, 2014 2:38 AM
    • Marked as answer by Naretto Monday, March 10, 2014 3:32 AM
    Monday, March 10, 2014 2:38 AM
  • Thanks 

    http://forums.asp.net/p/1973365/5644970.aspx?Re+ASP+NET+MVC+returning+cleared+form+and+not+submitting

    Monday, March 10, 2014 3:32 AM
  • Hi,

    So in this scenario you have to clear your model state if you return back to the same view. Try following:

        ModelState.Clear();
        return View(vm);

    Thanks

    Tuesday, October 18, 2016 12:43 PM