This article will show you how you can render a partial view inside an asp.net mcv view using jquery without page refresh with please wait method.
So for this article first we will create a new asp.net mvc application and add a controller class file in it. After this we will create a view of controller action.
Now check the output.
So for this article first we will create a new asp.net mvc application and add a controller class file in it. After this we will create a view of controller action.
[HttpGet]
public ActionResult
Login()
{
return View();
}
public ActionResult
PartialView()
{
return View();
}
|
Now we will create the view.
@{
ViewBag.Title
= "Index";
}
<script src="~/Scripts/jquery-1.10.2.js"></script>
<script>
$(document).ready(function () {
$('#user_content').html("Please wait....");
var url = "/Home/PartialView";
$('#user_content').load(url);
});
</script>
<div id="user_content" style="width:90%; top: 5%;left: 5%;">
</div>
|
Now create the partial view with action.
@{
ViewBag.Title
= "Index";
Layout = "";
}
<h1>This is partial
view class example</h1>
|
0 comments:
Please let me know your view