Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

My Partial View is not rendering inside the parent view after an Ajax call

$
0
0

Hi:

I spent several days trying to figure it out why when I try refresh my partial view from an ajax call, the partial view is rendered without the layout.

My partial view is very basic, a textbox with a submit button.  When you click the button,a javascript function is called to invoke an action method via ajax.

The action returns a ActionResult using the return PartialView("_myView", model)

Then on the javascript I am replacing the content of the div with the resulting html from the ajax call as follows:

$('#dv#').html(data)

Then if you fill the textbox again and click the submit again, the partial view losses the layout.

When I inspect the data, it looks fine.

Any idea why this happens

Thanks


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>