Beispiel #1
0
 public void p5_web_send_javascript(ApplicationContext context, ActiveEventArgs e)
 {
     // Looping through each JavaScript snippet supplied
     foreach (var idxSnippet in XUtil.Iterate <string> (context, e.Args))
     {
         // Passing JavaScript to client
         AjaxPage.SendJavaScript(idxSnippet);
     }
 }
Beispiel #2
0
 public void p5_web_set_location(ApplicationContext context, ActiveEventArgs e)
 {
     // Checking if this is ajax callback, which means we'll have to redirect using JavaScript
     if (AjaxPage.IsAjaxRequest)
     {
         // Redirecting using JavaScript
         AjaxPage.SendJavaScript(string.Format("window.location='{0}';", XUtil.Single <string> (context, e.Args).Replace("'", "\\'")));
     }
     else
     {
         // Redirecting using Response object
         AjaxPage.Response.Redirect(XUtil.Single <string> (context, e.Args));
     }
 }
Beispiel #3
0
 public void p5_web_set_location(ApplicationContext context, ActiveEventArgs e)
 {
     // Checking if this is ajax callback, which means we'll have to redirect using JavaScript
     if (AjaxPage.IsAjaxRequest)
     {
         // Redirecting using JavaScript.
         AjaxPage.SendJavaScript(string.Format("window.location='{0}';", XUtil.Single <string> (context, e.Args).Replace("'", "\\'")));
     }
     else
     {
         // Redirecting using Response object.
         try {
             AjaxPage.Response.Redirect(XUtil.Single <string> (context, e.Args));
         } catch (System.Threading.ThreadAbortException) {
             ; // Silently catching, no reasons to allow it to penetrate ...
         }
     }
 }
Beispiel #4
0
 public void p5_web_reload_location(ApplicationContext context, ActiveEventArgs e)
 {
     // Redirecting using JavaScript.
     AjaxPage.SendJavaScript("window.location.replace(window.location.href);");
 }