本文整理汇总了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);
}
}
}
}
示例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);
}
示例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));
}
}
示例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);
}
示例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);
}
}
示例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);
}
示例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
}
示例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
}
示例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
}
示例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
}
示例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
}
示例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
}
示例13: AppendScript
/// <summary>
/// 向当前页面动态输出客户端脚本代码
/// </summary>
/// <param name="javascript">javascript脚本段</param>
/// <param name="page">Page类的实例</param>
/// <param name="afterForm">是否紧跟在<form>标记之后输出javascript脚本,如果不是则在</form>标记之前输出脚本代码</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);
}
}
示例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
}
示例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);
}
}