本文整理匯總了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);
}
}