/// <summary> /// 调整窗口大小和位置 /// </summary> /// <param name="windowFeature"></param> public static void AdjustWindow(IWindowFeature windowFeature) { RequiredScript(typeof(DeluxeScript)); string clintObject = WindowFeatureHelper.GetClientObject(windowFeature); string script = string.Format("$HGRootNS.WindowFeatureFunction.adjustWindow({0});", clintObject); Page page = GetCurrentPage(); DeluxeClientScriptManager.RegisterStartupScript(page, script); }
/// <summary> /// 获取调整窗口大小和位置脚本 /// </summary> /// <param name="windowFeature"></param> /// <param name="addScriptTags"></param> /// <returns></returns> public static string ToAdjustWindowScriptBlock(this IWindowFeature windowFeature, bool addScriptTags) { string requireScript = WebUtility.GetRequiredScriptBlock(typeof(DeluxeScript)); string clintObject = WindowFeatureHelper.GetClientObject(windowFeature); //string callScript = string.Format("$HGRootNS.WindowFeatureFunction.adjustWindow({0});", clintObject); string callScript = string.Format("$HGRootNS.WindowFeatureFunction.registerAdjustWindow({0});", clintObject); string script = string.Format("{0}\n{1}", requireScript, callScript); if (addScriptTags) { script = DeluxeClientScriptManager.AddScriptTags(script); } return(script); }