0

I get tired of waiting when the whole page refreshes even though I have made changes to the partial views. =)

Is there a way where I can only reload those partial views (through the browser console) and not the whole page? :D

enter image description here

Its stupid but worth a shot!

P.S. I admit I am a lazy developer :P

Vivek Parekh
  • 1,075
  • 9
  • 25
  • 1
    I think you are looking for AJAX – DmitryK Feb 27 '14 at 11:26
  • Can I reload the partial using ajax in browser console?? – Vivek Parekh Feb 27 '14 at 11:26
  • yes, just google for "AJAX refresh partial views"... http://stackoverflow.com/questions/10564556/asp-net-mvc3-ajax-partial-view-refresh – DmitryK Feb 27 '14 at 11:29
  • No.! I want to refresh it using browser console. I mean developer tools that are supported by Web Browser such as in Chrome – Vivek Parekh Feb 27 '14 at 11:31
  • Why is it taking so long for your website to load? Maybe look into that first. – putvande Feb 27 '14 at 11:33
  • You cant load just a part of a website if this website isn't made for this, means that what you want to do isn't possible... – ReeCube Feb 27 '14 at 11:33
  • @putvande I think he doesn't want to reload his website, I think he wants to reload any website ;-) – ReeCube Feb 27 '14 at 11:34
  • I guess it is possible if you know the structure of server-side (For example: you know that "/url/site/xxx", reutrn the comments, so you ask for it to the server and then update it ), but it is a pain....why would you want to do this? – DmitryK Feb 27 '14 at 11:40
  • The website takes time to load. And when I make changes to a partial view then I have to reload the whole page. :( Also I have tried everything to make the page as fast as possible. :| – Vivek Parekh Feb 27 '14 at 11:42
  • Any browser-specific extensions/plugin would also be great.! Or any extension in visual studio!? – Vivek Parekh Feb 27 '14 at 11:44

2 Answers2

0

If you want to see your changes immediately reflected to the webpage, then LiveReload can help.

Bikas
  • 2,709
  • 14
  • 32
0

You are looking for Ajax.

Example:

<p id="yourContent">old content</p>

<script>
$(document).ready(function() {
    $.ajax({
       url: 'url_to_your_new_content.php'
    }).done(function( data ) {
       $('#yourContent').text(data);
    });
});
</script>
ReeCube
  • 2,545
  • 17
  • 23