I have a ASP page which has a gridview. I have set the gridview height and width in javascript by using window.height and window.width. But when user resizes the browser the gridview size is not updated as it occurs only during page load. So how can I make gridview to set to page size when user resizes the browser window . I used below code As mentioned in link . But it reloads the page again and Page_load from code behind is run again and again data are retrieved from database etc. So is there any other methods without loading the page(Form_load) again?
jQuery(function($){
var windowWidth = $(window).width();
$(window).resize(function() {
if(windowWidth != $(window).width()){
location.reload();
return;
}
});
});