Sunday, 16 October 2016

Render Partial View in MVC Using jQuery

10/16/2016 - By Pranav Singh 0

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.


[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>

Now check the output.





About the Author

We are the group of people who are expertise in different Microsoft technology like Asp.Net,MVC,C#.Net,VB.Net,Windows Application,WPF,jQuery,Javascript,HTML. This blog is designed to share the knowledge.

Get Updates

Subscribe to our e-mail newsletter to receive updates.

Share This Post

0 comments:

Please let me know your view

Free Ebooks


About Us

We are the group of people who are expertise in different Microsoft technology like Asp.Net,MVC,C#.Net,VB.Net,Windows Application,WPF,jQuery,Javascript,HTML. This blog is designed to share the knowledge.

Contact Us

For writing article in this website please send request by your

GMAIL ID: dotnetpools@gmail.com

Bugs and Suggestions

As we all know that this website is for sharing knowledge and providing proper solution. So while reading the article is you find any bug or if you have any suggestion please mail us at contact@aspdotnet-pools.com.

Partners


Global Classified : Connectseekers.com
© 2014 aspdotnet-pools.com Designed by Bloggertheme9.
back to top