asp.net - Control different views for website through query parameters -


i building asp.net mvc application has left navigation pane showing categories, , remaining page uses context of selected category actions.

when navigate website http://website/home/index?category=1&hidecategories=true want hide navigation pane across actions till browser tab closed. want show navigation pane otherwise.

how can achieve while supporting following scenarios,

  • i want open 2 browser tabs side side 1 browser tab hiding categories pane while other browser tab showing navigation pane.

if want isolation between tabs, per browser tab storage, can use session storage.

using javascript can save value session storage this:

sessionstorage.setitem("hidecategories", "true"); 

then can access value this:

var x = sessionstorage.getitem("hidecategories"); if(x === "true"){   //some logic hide categories } 

you can set value per browser tab, can have 1 tab nav hidden , 1 tab not.

data stored in sessionstorage not persist after browser closed.


Comments

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -