2

I have multiple partial views in one page, when there is a submit on one partial view, and there is a model level validation on it, I need to stay in the same Page.

Using the below code

 return PartialView(<modelname>)

Redirects to a new page and not to the same parent page where the request came from.

Please let me know how to resolve this

NetStarter
  • 3,189
  • 7
  • 37
  • 48

1 Answers1

0

If you are using Razorengine, then you could try this code

@Html.Partial("ViewName", ModelName)

In the Partial view you can use Ajax.BeginForm to call your controller and model which will be used on hit of submit button

lakshmi
  • 1
  • 2