c# - double quotation mark inside url and WebBrowser -


i got decent problem webbrowser control in windows phone 8. have registered custom uriparser allows send commands via window.location.href = "myprotocoll://processcommand(17, 'jscriptcallback', '{\"data0\":\"hello\"}')" works great except if start add double quotationmarks, in example. ({"data0":"hello"}) becomes necessary if want send json string. there no error output no exception in app nothing if try navigate url via window.location.href nothing happen. think strange behavoir.

my uriparser:

public class myuriparser : uriparser {     public myuriparser()     {      }      protected override string getcomponents(uri uri, uricomponents components, uriformat format)     {         return "";     }     protected override bool iswellformedoriginalstring(uri uri)     {         return true;     }     protected override void initializeandvalidate(uri uri, out uriformatexception parsingerror)     {         parsingerror = null;     }     protected override bool isbaseof(uri baseuri, uri relativeuri)     {         return false;     }     protected override string resolve(uri baseuri, uri relativeuri, out uriformatexception parsingerror)     {         parsingerror = null;         return "";     } } 

registered via:

if (!uriparser.isknownscheme(schemename_0))     uriparser.register(new myuriparser(), schemename_0, 80); 

your quotation marks terminating string, causing odd behavior. when using quotation marks want stay inside string, use '\' before quotation marks don't end string. in case, you'd want like:

window.location.href = "myprotocoll://processcommand(17, 'jscriptcallback', '{\"data0\":\"hello\"}')"


Comments

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -