2

How do i return a partial view inside a master page after submitting a form. Basically what i'm trying to do is display form validation errors, but the problem i can only manage to return a partial view not the master page or full view that its in. Any suggestions?

1
  • i'd rather a solution that didn't rely on ajax to start with... Commented Jun 18, 2009 at 14:45

3 Answers 3

1

I'm using MS Mvc with spark + jquery so I'm not sure if it solves your problem but what I think you have to do is return a partial and say which part of page have to be updated (by id of DOM element).

Sign up to request clarification or add additional context in comments.

Comments

1

Is ajax an option? An XMLHttpRequest could refresh just the partial view, not break your architecture, and keep the page from refreshing. I would use jquery.

Comments

1

The solution i ended up doing was passing the ModelState in TempData and adding the errors back into ModelState in the partialview. It works where other solutions did not. Also performed client side validation as well but thats kind of irrelevant as i was after a server side solution.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.