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

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -