javascript - How to reload page without _layout query string parameter -
page url in form
http://example.com/myapp?param1=1&otherparam=somevalue1&_layout=somevalue2&someother=something
page contains button "reset layout" invokes javascript code:
window.location.reload();
how reload page without _layout=somevalue2
parameter ? possible/reasonable use javascript ? asp.net mvc3 application. if javascript not reasonable, how call server side controller ?
jquery , bootstrap 3 used.
you can use regular expression , remove instance of _layout
location.href=location.href.replace(/&?_layout=([^&]$|[^&]*)/i, "");
Comments
Post a Comment