How to get the QueryString? [SOLVED]
Posted: Wed Sep 30, 2015 7:52 am
I want to get the query string for the url. But I don't know how to do this, is any code or sample can help me? 

Code: Select all
public static string GetQueryString()
{
if (CSharpXamlForHtml5.Environment.IsRunningInJavaScript)
{
string url = JSIL.Verbatim.Expression("window.location.toString()");
string queryString = (url.IndexOf('?') >= 0 ? url.Substring(url.IndexOf('?') + 1) : "");
return queryString;
}
else
{
MessageBox.Show("The query string cannot be obtained when running inside the Simulator.");
return "";
}
}
JS-Support wrote:Hi,
Sure!
To get the query string, please use the following method:Code: Select all
public static string GetQueryString()
{
if (CSharpXamlForHtml5.Environment.IsRunningInJavaScript)
{
string url = JSIL.Verbatim.Expression("window.location.toString()");
string queryString = (url.IndexOf('?') >= 0 ? url.Substring(url.IndexOf('?') + 1) : "");
return queryString;
}
else
{
MessageBox.Show("The query string cannot be obtained when running inside the Simulator.");
return "";
}
}
Regards,
JS-Support