public static void RegisterJavaScriptFile(System.Web.UI.Page page, String key, String filename)
 {
   if (!page.ClientScript.IsStartupScriptRegistered(key))
     page.ClientScript.RegisterStartupScript(page.GetType(), key,
       String.Format("<SCRIPT language=\"javascript\" src=\"{0}\"></SCRIPT>",
       HttpUtils.GetApplicationPath("scripts/" + filename)));
 }
Exemple #2
0
        public static String GetApplicationPath(String partialUrl)
        {
            /* Remove the leading / character, since the last character
             * in the String returned by GetApplicationPath is guaranteed
             * to be a / character. */

            return(HttpUtils.GetApplicationPath() + partialUrl.TrimStart("/".ToCharArray()));
        }
 public static String GetImageAnchorElement(String imageName, Int32 border, Int32 width, Int32 height, String cssClass)
 {
     return(String.Format("<IMG src=\"{0}\" border=\"{1}\" width=\"{2}\" height=\"{3}\" class=\"{4}\">",
                          HttpUtils.GetApplicationPath() + imageName, border, width, height, cssClass));
 }
Exemple #4
0
 public static String GetSecureApplicationPath(String partialUrl)
 {
     return(HttpUtils.GetApplicationPath().Replace("http://", "https://") + partialUrl);
 }