當前位置: 首頁>>代碼示例>>C#>>正文


C# Page.GetType方法代碼示例

本文整理匯總了C#中System.Web.UI.Page.GetType方法的典型用法代碼示例。如果您正苦於以下問題:C# Page.GetType方法的具體用法?C# Page.GetType怎麽用?C# Page.GetType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Web.UI.Page的用法示例。


在下文中一共展示了Page.GetType方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: CheckForUpdate

 internal void CheckForUpdate(ref Page page)
 {
     Operation operation;
     if (!TryGetLatestOperation(out operation, ref page))
     {
         if (page.GetType().BaseType != typeof (Error))
         {
             RedirectToErrorPage(ref page);
         }
     }
     else
     {
         if (operation == null)
         {
             if (page.GetType().BaseType != typeof (Idle))
             {
                 RedirectToNoAlarm(ref page);
             }
         }
         else
         {
             if (operation.Id.ToString(CultureInfo.InvariantCulture) == HttpContext.Current.Request["id"])
             {
                 if (operation.IsAcknowledged)
                 {
                     RedirectToNoAlarm(ref page);
                 }
             }
             else
             {
                 page.Response.Redirect("Default.aspx?id=" + operation.Id);
             }
         }
     }
 }
開發者ID:Bolde,項目名稱:AlarmWorkflow,代碼行數:35,代碼來源:ServiceConnection.cs

示例2: CloseWindow

 /// <summary>
 /// 關閉當前窗口
 /// </summary>
 public static void CloseWindow(Page page)
 {
     string js = @"<script type='text/javascript'>
             parent.opener=null;window.close();
           </script>";
     if (page.ClientScript.IsStartupScriptRegistered(page.GetType(), "close"))
         page.ClientScript.RegisterStartupScript(page.GetType(), "close", js);
 }
開發者ID:vanzheng,項目名稱:JellyFramework,代碼行數:11,代碼來源:JavascriptUtils.cs

示例3: AlertAndRedirect

 /// <summary> 
 /// 彈出消息框並跳轉向到新的URL 
 /// </summary> 
 /// <param name="message">消息內容</param> 
 /// <param name="toURL">跳轉頁麵的地址</param> 
 /// <param name="page">當前頁麵對象,如this.Page</param>
 public static void AlertAndRedirect(string message, string toURL, Page page)
 {
     string js = "<script language=javascript>alert('{0}');window.location.replace('{1}')</script>";
     if (!page.ClientScript.IsStartupScriptRegistered(page.GetType(), "AlertAndRedirect"))
     {
         page.ClientScript.RegisterStartupScript(page.GetType(), "AlertAndRedirect", string.Format(js, message, toURL));
     }
 }
開發者ID:cityjf,項目名稱:FanFunction,代碼行數:14,代碼來源:clsAlertAndRedirect.cs

示例4: GoHistory

 /// <summary>
 /// 回到曆史頁麵
 /// </summary>
 /// <param name="value">-1/1</param>
 public static void GoHistory(int value, Page page)
 {
     string js = @"<script type='text/javascript'>
             history.go({0});
           </script>";
     if (page.ClientScript.IsStartupScriptRegistered(page.GetType(), "gohistory"))
         page.ClientScript.RegisterStartupScript(page.GetType(), "gohistory", js);
 }
開發者ID:vanzheng,項目名稱:JellyFramework,代碼行數:12,代碼來源:JavascriptUtils.cs

示例5: ExcuteJavascriptCode

 /// <summary>
 /// 將傳入的Javascript字符串值作為代碼執行
 /// </summary>
 /// <param name="jsContent">傳入的Javascript字符</param>
 /// <param name="page">相關的頁麵</param>
 public static void ExcuteJavascriptCode(string jsContent,Page page)
 {
     string js = "<script language=javascript>" + jsContent + "</script>";
     if (!page.ClientScript.IsStartupScriptRegistered(page.GetType(), "ExcuteJavascriptCode"))
     {
         page.ClientScript.RegisterStartupScript(page.GetType(), "ExcuteJavascriptCode",js);
     }
 }
開發者ID:skyaspnet,項目名稱:usta,代碼行數:13,代碼來源:Javascript.cs

示例6: LocationNewHref

 /// <summary>
 /// 轉向指定的Url
 /// </summary>
 /// <param name="html"></param>
 public static void LocationNewHref(string url, Page page)
 {
     string js = @"<script type='text/javascript'>
             window.location.replace('{0}');
           </script>";
     js = string.Format(js, url);
     if (page.ClientScript.IsStartupScriptRegistered(page.GetType(), "location"))
         page.ClientScript.RegisterStartupScript(page.GetType(), "location", js);
 }
開發者ID:vanzheng,項目名稱:JellyFramework,代碼行數:13,代碼來源:JavascriptUtils.cs

示例7: GoHistory

 /// 回到曆史頁麵 </summary>
 /// <param name="value">-1/1</param>     
 ///  <param name="page">Web窗體頁</param>        
 public static void GoHistory(int value, Page page)
 {
     #region
     string js = @"<Script language='JavaScript'>history.go({0});</Script>";
     if (!page.ClientScript.IsStartupScriptRegistered(page.GetType(), "GoHistory"))
     {
         page.ClientScript.RegisterStartupScript(page.GetType(), "GoHistory", string.Format(js, value));
     }
     #endregion
 }
開發者ID:yjtang,項目名稱:AutoBws,代碼行數:13,代碼來源:yvonMsgBox.cs

示例8: AlertJS

 /// <summary>彈出JavaScript小窗口</summary>   
 /// <param name="message">提示信息</param>    
 /// <param name="page">Web窗體頁</param>     
 public static void AlertJS(string message, Page page)
 {
     #region
     string js = @"<Script language='JavaScript'>alert('" + message + "');</Script>";
     if (!page.ClientScript.IsStartupScriptRegistered(page.GetType(), "alert"))
     {
         page.ClientScript.RegisterStartupScript(page.GetType(), "alert", js);
     }
     #endregion
 }
開發者ID:yjtang,項目名稱:AutoBws,代碼行數:13,代碼來源:yvonMsgBox.cs

示例9: AlertSuccess

 public static void AlertSuccess(string message, Page page)
 {
     #region
     string js = @"<Script language='JavaScript'>ymPrompt.setDefaultCfg({title:'Title',okTxt:' OK ',cancelTxt:' Cancel ',closeTxt:'Close',minTxt:'Minimize',maxTxt:'Maximize'});ymPrompt.succeedInfo('" + message + "',null,null,null,null);</Script>";
     if (!page.ClientScript.IsStartupScriptRegistered(page.GetType(), "alert"))
     {
         page.ClientScript.RegisterStartupScript(page.GetType(), "alert", js);
     }
     #endregion
 }
開發者ID:yjtang,項目名稱:AutoBws,代碼行數:10,代碼來源:yvonYmPrompt.cs

示例10: JavaScriptLocationHref

 /// <summary>轉向Url製定的頁麵 </summary>      
 /// <param name="url">連接地址</param> 
 /// <param name="page">Web窗體頁</param>     
 public static void JavaScriptLocationHref(string url, Page page)
 {
     #region
     string js = @"<Script language='JavaScript'>window.location.replace('{0}');</Script>";
     js = string.Format(js, url);
     if (!page.ClientScript.IsStartupScriptRegistered(page.GetType(), "JavaScriptLocationHref"))
     {
         page.ClientScript.RegisterStartupScript(page.GetType(), "JavaScriptLocationHref", js);
     }
     #endregion
 }
開發者ID:yjtang,項目名稱:AutoBws,代碼行數:14,代碼來源:yvonMsgBox.cs

示例11: AlertAndRedirect

 /// <summary>
 /// 彈出消息框並且轉向到新的URL
 /// </summary>
 /// <param name="message">消息內容</param>
 /// <param name="toURL">連接地址</param>
 public static void AlertAndRedirect(string message, string toURL, Page page)
 {
     #region
     string js = "<script type='text/javascript'>alert('{0}');window.location.replace('{1}')</script>";
     //HttpContext.Current.Response.Write(string.Format(js, message, toURL));
     if (!page.ClientScript.IsStartupScriptRegistered(page.GetType(), "AlertAndRedirect"))
     {
         page.ClientScript.RegisterStartupScript(page.GetType(), "AlertAndRedirect", string.Format(js, message, toURL));
     }
     #endregion
 }
開發者ID:popotans,項目名稱:hjnlib,代碼行數:16,代碼來源:JscriptUtil.cs

示例12: Alert

 /// <summary>
 /// 彈出JavaScript小窗口
 /// </summary>
 /// <param name="message">窗口信息</param>
 /// <param name="page">Page類的實例</param>
 public static void Alert(string message, Page page)
 {
     #region
     string js = @"<script type='text/javascript'>
             alert('" + message + "');</script>";
     if (!page.ClientScript.IsStartupScriptRegistered(page.GetType(), "alert"))
     {
         page.ClientScript.RegisterStartupScript(page.GetType(), "alert", js);
     }
     #endregion
 }
開發者ID:changweihua,項目名稱:FirstLog,代碼行數:16,代碼來源:ScriptHelper.cs

示例13: AppendScript

 /// <summary>
 /// 向當前頁麵動態輸出客戶端腳本代碼
 /// </summary>
 /// <param name="javascript">javascript腳本段</param>
 /// <param name="page">Page類的實例</param>
 /// <param name="afterForm">是否緊跟在&lt;form&gt;標記之後輸出javascript腳本,如果不是則在&lt;/form&gt;標記之前輸出腳本代碼</param>
 public static void AppendScript(string javascript, Page page, bool afterForm)
 {
     if (afterForm)
     {
         page.ClientScript.RegisterClientScriptBlock(page.GetType(), page.ToString(), javascript);
     }
     else
     {
         page.ClientScript.RegisterStartupScript(page.GetType(), page.ToString(), javascript);
     }
 }
開發者ID:changweihua,項目名稱:FirstLog,代碼行數:17,代碼來源:ScriptHelper.cs

示例14: GoHistory

 /// <summary>
 /// 回到曆史頁麵
 /// </summary>
 /// <param name="value">-1/1</param>
 public static void GoHistory(int value, Page page)
 {
     #region
     string js = @"<Script type='text/javascript'>
       history.go({0});
           </Script>";
     //HttpContext.Current.Response.Write(string.Format(js, value));
     if (!page.ClientScript.IsStartupScriptRegistered(page.GetType(), "GoHistory1"))
     {
         page.ClientScript.RegisterStartupScript(page.GetType(), "GoHistory1", string.Format(js, value));
     }
     #endregion
 }
開發者ID:popotans,項目名稱:hjnlib,代碼行數:17,代碼來源:JscriptUtil.cs

示例15: DoSuccess

 public static void DoSuccess(string str, bool isClose, Page page)
 {
     if (str == "")
     {
         str = "操作信息成功!";
     }
     if (isClose)
     {
         ScriptManager.RegisterClientScriptBlock(page, page.GetType(), "show", "alert('" + str + "', this);window.close();", true);
     }
     else
     {
         ScriptManager.RegisterClientScriptBlock(page, page.GetType(), "show", "alert('" + str + "');window.opener.location.reload();window.close();", true);
     }
 }
開發者ID:SoMeTech,項目名稱:SoMeRegulatory,代碼行數:15,代碼來源:PageShowText.cs


注:本文中的System.Web.UI.Page.GetType方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。