executing script ASP.NET application
<p>In my ASP.NET application default page is Login.aspx.<br>
In this page I check the Query string, if it is empty I load the page, but if query string has parameters I want to launch the application on client.<br>
This is working when first I browse my application without parameters (<code>http://localhost/myApps</code>), and then browse the application with some parameters (<code>http://localhost/myApps?ID='test'</code>).<br>
But if I directly browse the site with <code>http://localhost/myApps?ID='test'</code>, it is not working.</p>

<p>Following is the code of my Global.asax page</p>

<pre><code>public class Global : System.Web.HttpApplication
    {
        protected void Application_BeginRequest(object sender, EventArgs e)
        {
            System.Web.HttpContext httpCurrent;
            httpCurrent = System.Web.HttpContext.Current;
            string  currentURL;
            if (Request.QueryString.Count == 4)
            {
                string PID = Request.QueryString["PID"].ToString();
                string sid = Request.QueryString["acc_no"].ToString();
                string uid = Request.QueryString["userID"].ToString();
                string uname = Request.QueryString["username"].ToString();
         currentURL = "ViewImages.aspx?PID=" + PID + "&amp;acc_no=" + sid + "&amp;userID=" + uid + "&amp;username=" + uname;
                httpCurrent.RewritePath(currentURL);
            }
            else
            {
                currentURL = "Login.aspx?";
                httpCurrent.RewritePath(currentURL);
       }
        }
 }
</code></pre>
