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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T14:33:07+00:00 2026-06-02T14:33:07+00:00

This problem is very strange, maybe I have missed some small detail, since I’m

  • 0

This problem is very strange, maybe I have missed some small detail, since I’m new to mvc 3…

In a partial view, I have a different model than in the main view (I don’t think that it matters in this case). I have added a couple of Validation-helper calls in the view. No matter what I do, they dont show up on the page.

I have enabled framework source debugging, and I can see that the HTML is generated, and are written to “output”. Still, they dont appear in the final rendered page. I cannot understand why.

In my partial view:

@model ModelsDTO.Domain.GridRowDTO
@Html.ValidationSummary()
@Html.TextBox("Kalla")
@Html.ValidationMessage("Kalla")

I have the textbox there just to see if it renders. It does.

My controller code (hard coded message, just to try to make it work):

[HttpPost]
public ActionResult SaveGridRow(GridRowDTO rad)
{
    List<string> valideringsFel = _dagboksanteckning.SaveDagbokObjekt(rad);

    ModelState.AddModelError("Kalla", "Källan felaktig");

    return PartialView("_DagbokGrid", rad);
}

The model:

public class GridRowDTO
{
    public string Kronika { get; set; }
    public string Ok { get; set; }
    public string Datum { get; set; }
    public string Tid { get; set; }
    public string Kalla { get; set; }
    public string Handelse { get; set; }
    public string Bedomning { get; set; }
    public string Till { get; set; }
    public string Rubrik { get; set; }
    public string Verksamhetsslag { get; set; }
    public string OperationPadrag { get; set; }
    public string Verksamhetskod { get; set; }
    public string LatitudTecken { get; set; }
    public string Latitud { get; set; }
    public string LongitudTecken { get; set; }
    public string Longitud { get; set; }
    public string Media { get; set; }
    public string AnnatDokument { get; set; }
    public string Region { get; set; }
    public string id { get; set; }
}

Edit, very interesting finding!

When tracing the call with IE9 F12-mode, the response text acutally contains the expected HTML! Why does’nt it render!

<div class="validation-summary-errors"><ul><li>K&#228;llan felaktig</li>
</ul></div>

<input class="input-validation-error" id="Kalla" name="Kalla" type="text" value="1" />
<span class="field-validation-error">K&#228;llan felaktig</span>

I would be really thankfull if I could get some assistance to understand this problem.

  • 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-02T14:33:08+00:00Added an answer on June 2, 2026 at 2:33 pm

    If you are calling this controller action using AJAX you should make sure that you are substituting the contents of the partial with the new value. For example assuming your partial is wrapped inside a div:

    <div id="container">
        @Html.Patrial(....)
    </div>
    

    Now inside the success callback make sure you have refreshed the contents of the div:

    $.ajax({
        url: '@Url.Action("SaveGridRow")',
        type: 'POST',
        data: ...,
        success: function(result) {
            // Here you must refresh the div or whatever part of the DOM
            // you need to update
            $('#container').html(result);
        }
    });
    

    or if you are using Ajax.* helpers to call the action make sure you have specified UpdateTargetId in the AjaxOptions and that this value corresponds to the id of some DOM element you want to refresh.

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

Sidebar

Related Questions

Hello I have very strange problem and maybe some of you could help my.
I have this strange, yet maybe very simple problem.. I have a timer1 in
Starting from Android 3.2 I have this strange problem. It's very easy to reproduce:
This problem is very strange and I'm hoping someone can help me. For the
This is a very strange problem, and I just hope that I can clearly
I have an issue that seems like very flaky behavour, is this a problem
I am experiencing some very strange behavior with Blend: Since weeks i am working
This is a very strange problem. I've got a rails app in which I
I am facing a very strange problem. I have a grid and when i
Ok, lt me explain to you this very strange problem on which I am

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.