javascript - Passing variables between ASP MVC pages without sending it to server -
i creating website asp.net mvc 4. application consists of 2 pages, workflow similar google maps. on first page, user types in patient's name, date of birth, , basic data patient. user submits form, , brought second page in application. second page print preview user can print. want user able navigate between 2 pages using browser's , forward buttons (for example, change inputs on first page after seeing second page)
actually calculating data appears on printout complicated, , want have code executed server-side, can use c#. need send patient's data server. problem don't have ssl certificate, , don't want send patient's name data on http (as violation of privacy). willing send patient's data on http, long remains detached patient's identity (except @ client). name , date of birth displayed in corner of printout, , not affect server-side calculations in least.
i can think of 2 possible ways accomplish task. first, more preferred solution, way send of form data on http, yet still somehow name , date of birth first page in client-side jquery running on second page. maybe can make cookie , somehow specify not send part of http request?
the other way accomplish make entire application single page, , dynamically change contents via client-side jquery. in solution, when user submits form, can fire off ajax request return json. can populate print preview data returned server (i.e. json) form (i.e. patient's name , date of birth). there way accomplish while still allowing user use browser's , forward commands navigate between data input page , print preview page if in fact same page?
i don't believe described possibly without severe drawbacks. sure, roll data cookie or local storage , avoid post--but lot of logic in view, , pretty nasty hack.
the options advise are:
get ssl cert. if that's driving force behind approach spend $6 one. seriously.
keep print view in same page form; use css
@media
types specify print styles.
Comments
Post a Comment