knockout in asp.net web from master page -


good day.

i using knockout in asp.net web form master page. on master page have advanced search control knockout. after selecting search criteria readio buttons, tabs , dropdowns, on clicking search button redirect details page inherited same master page.

i need persists selected view first page in details page along populating search result.

but i'm unable infant in knockout.

i guess if can remove binding , apply again, happen.(don't know i'm wrong or not).

kindly advice me on situation.

thanks

santhi

it sounds you're doing complete trip server between pages. in case you'll need store state of search box somehow before redirect, , load state after redirect. have couple ways this.

using cookies

you serialize state of select control json string , store in cookie. when search box loads, cookie using javascript , if exists, load data search box.

using query string

you serialize state of select control query string, , load that. little bit more reliable in case cookies turned off on user's browser.

using local storage

if you're working in modern browsers , supporting html 5, use html 5 local storage store search state between postbacks. http://diveintohtml5.info/storage.html

serializing model state

take @ page of knockout js documentation more info on serializing object graph. http://knockoutjs.com/documentation/json-data.html

i hope helps!


Comments