javascript - using a redirect to launch an app and still stay in same page in asp.net -


i have written website uses bankid authentication, don't know how common outside of sweden, either app in mobile phone, or local software in windows. launch application in windows redirect needs made looks this:

if (startlocalapp)             {                 response.redirect("bankid:///?autostarttoken=" + authresp.authenticateresponse1.autostarttoken + "&redirect=" + request.url.absoluteuri);             } 

the problem though redirect of software not work way need work since redirect opens new tab web page need in new tab, , session variable messed up. need opposite, launch app in new tab, , let close tab when it's done, since have references needed before i've launched app not need executed in same browser window even.

so how make redirect in tab, , possible keep executing code after redirect? if not, need make post continue execution of code-behind.

edit: i've tried 1 solution, feels i'm getting closer i'm not quite there yet. front-end:

<script type="text/javascript">     function startbankidapp(){         var _url = 'bankid:///?autostarttoken=<%= (authresp == null || authresp.authenticateresponse1 == null) ? "null" : authresp.authenticateresponse1.autostarttoken %>&redirect=null';         var $irwin = window.open(_url, '_blank');         if ($irwin != null) {             $irwin.close();         }     } </script> 

code-behind:

if (startlocalapp) {     scriptmanager.registerstartupscript(this, this.gettype(), startbankidapp", "startbankidapp()", true); } 

the app not launched, i.e window should open not open. did wrong?

i think trying use "url scheme" launch app. , want app should triggered in new tab (or window).

this can achieved through javascript. open link in new tab can use window.open , set target attribute _blank. here sample code

var _url = 'app:myapp?querystring=somestring'; var $irwin = window.open(_url, '_blank'); if ($irwin != null) {    $irwin.close(); } 

what i've done here after launching app i've closed new tab (or window).

the javascript code continue run (that not wait app complete process).


Comments

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -