当前位置: 首页>>代码示例>>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;未经允许,请勿转载。