private void RegisterScript() { string cbReference = ClientScript.GetCallbackEventReference(this, "arg", "ReceiveServerData", "context"); string callbackScript = "function CallServer(arg, context) {" + cbReference + "; }"; ClientScript.RegisterClientScriptBlock(this.GetType(), "CallServer", callbackScript, true); }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); ClientScript.GetCallbackEventReference(this, "arg", "callback", "context"); btnSend.Click += new EventHandler(btnSend_Click); if (!Page.IsPostBack) { txtSubject.Text = Request.QueryString["subject"]; txtName.Text = Request.QueryString["name"]; txtEmail.Text = Request.QueryString["email"]; GetCookie(); phAttachment.Visible = BlogSettings.Instance.EnableContactAttachments; SetFocus(); } if (!IsPostBack && !IsCallback) { recaptcha.Visible = UseCaptcha; recaptcha.UserUniqueIdentifier = hfCaptcha.Value = Guid.NewGuid().ToString(); } Page.Title = Server.HtmlEncode(Resources.labels.contact); base.AddMetaTag("description", Utils.StripHtml(BlogSettings.Instance.ContactFormMessage)); }
protected void Page_Load(object sender, EventArgs e) { this.initPage(); if (usi.UsingSystem == "") { usi.UsingSystem = "HINTS"; } if (!this.IsPostBack) { this.ConstructQuestionGroupTree(); } sCallBackFunctionInvocation = ClientScript.GetCallbackEventReference(this, "message", "show_callback", null); //this.ConstructQuestionGroupTree(); Ajax.Utility.RegisterTypeForAjax(typeof(AuthoringTool_CaseEditor_Paper_QuestionGroupTree_QGroupTree)); if (hiddenQuestionType.Value == "1" && hiddenQuestionType.Value != "") { strQuestionType = "選擇題"; } else { strQuestionType = "問答題"; } if (hiddenQuestionFunction.Value == "New") { strQuestionFunction = "編輯新問題"; lbQModeANDFunction.Text = "(" + strQuestionType + " " + strQuestionFunction + ")"; } else { strQuestionFunction = "修改或刪除問題"; lbQModeANDFunction.Text = "(" + strQuestionFunction + ")"; } }
protected void Page_Load(object sender, EventArgs e) { string cbReference = ClientScript.GetCallbackEventReference(this, "arg", "ReceiveServerData", "context"); string callbackScript = "function CallServer(arg, context) {" + cbReference + "; }"; ClientScript.RegisterClientScriptBlock(this.GetType(), "CallServer", callbackScript, true); }
//private void SetupScript() //{ // StringBuilder script = new StringBuilder(); // script.Append("\n<script type='text/javascript'>"); // script.Append("var myLayout; "); // script.Append("$(document).ready(function () {"); // script.Append("myLayout = $('body').layout({ "); // script.Append("applyDefaultStyles: true"); // script.Append(",west__paneSelector:'#" + pnlLeft.ClientID + "'"); // script.Append(",center__paneSelector:'#" + pnlCenter.ClientID + "'"); // script.Append(",west__size: 420 "); // script.Append("});"); // script.Append("});"); // script.Append("\n</script>"); // Page.ClientScript.RegisterStartupScript(typeof(Page), "cmessages", script.ToString()); //} private void LoadSettings() { pageId = WebUtils.ParseInt32FromQueryString("pageid", pageId); moduleId = WebUtils.ParseInt32FromQueryString("mid", moduleId); pageNumber = WebUtils.ParseInt32FromQueryString("pagenumber", pageNumber); timeOffset = SiteUtils.GetUserTimeOffset(); timeZone = SiteUtils.GetUserTimeZone(); if (moduleId > -1) { Module m = GetModule(moduleId, ContactFormMessage.FeatureGuid); if (m == null) { SiteUtils.RedirectToAccessDeniedPage(this); return; } moduleGuid = m.ModuleGuid; moduleSettings = ModuleSettings.GetModuleSettings(moduleId); pageSize = WebUtils.ParseInt32FromHashtable(moduleSettings, "ContactFormMessageListPageSizeSetting", pageSize); } sCallBackFunctionInvocation = ClientScript.GetCallbackEventReference(this, "messageGuid", "ShowMessage", "context", "OnError", true); //ScriptLoader sl = Page.Master.FindControl("ScriptInclude") as ScriptLoader; //if (sl != null) //{ // sl.IncludejQueryLayout = true; //} //SetupScript(); }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); if (!IsPostBack) { ClientCallback = ClientScript.GetCallbackEventReference(this, "argument", "processCallback", "null"); } }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); ClientScript.GetCallbackEventReference(this, "arg", "callback", "context"); Page.Title = Server.HtmlEncode(Resources.labels.contact); base.AddMetaTag("description", Utils.StripHtml(BlogSettings.Instance.ContactFormMessage)); }
protected void Page_Load(object sender, EventArgs e) { //base.Page_Load(sender, e); //cMsg = (Mensajes.msgBox)this.Master.FindControl("MsgBox1"); if (Context.Request.IsAuthenticated) { // retrieve user's identity from httpcontext user FormsIdentity ident = (FormsIdentity)Context.User.Identity; string perfil = ident.Ticket.UserData; if (perfil != "0") { Response.Redirect("~/Configuracion/Inicio.aspx?Permiso=NO"); return; } } else if (!IsPostBack) { Response.Redirect("~/Login.aspx"); return; } if (CallbackCompletado == null) { CallbackCompletado = new AsyncCallback(OnCallBackCompleted); } if (ServiceServiciosCD40 == null) { ServiceServiciosCD40 = new ServiciosCD40.ServiciosCD40(); } string cbReference = ClientScript.GetCallbackEventReference(this, "arg", "ReceiveServerData", "context", "ClientCallbackError", true); string callbackScript = "function CallServer(arg, context) {" + cbReference + "; }"; ClientScript.RegisterClientScriptBlock(this.GetType(), "CallServer", callbackScript, true); if (!IsPostBack) { Configuration config = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("~"); KeyValueConfigurationElement s = config.AppSettings.Settings["Sistema"]; RecuperaIdSectorizacionActiva(s.Value); RecuperaTops(s.Value); RecuperaSectoresActiva(s.Value); RecuperaSectorizaciones(s.Value); RecuperaSectoresSectorizaciones(s.Value); MuestraEstadoSectorizacion(); } else { EliminaFilas(); } }
protected void Page_Load(object sender, EventArgs e) { if (!this.IsPostBack) { ClientScript.GetCallbackEventReference(this, "", "", ""); if (this.Befor_Load_Tags()) { Bind_ListTag_44909_2(); } } }
protected void Page_Load(object sender, EventArgs e) { if (!this.IsPostBack) { ClientScript.GetCallbackEventReference(this, "", "", ""); if (this.Befor_Load_Tags()) { Bind_ReadTag_30122_8(); Load_LabelTag_16834_5(); } } }
protected bool flag = false; // 增加判斷是否顯示基本題目表的flag 老詹 2014/10/22 protected void Page_Load(object sender, EventArgs e) { Ajax.Utility.RegisterTypeForAjax(typeof(AuthoringTool_CaseEditor_Paper_QuestionGroupTree_QGroupTreeNew_VoiceInquiry)); this.initPage(); if (usi.UsingSystem == "") { usi.UsingSystem = "HINTS"; } if (!this.IsPostBack) { if (Session["bDisplayQuestionList"] != null) // 增加若顯示基本題目表時的動作 老詹 2014/10/21 { if (Session["bDisplayQuestionList"].ToString() == " Yes ") { Lb_HintsForQuestionList.Visible = true; flag = true; } bDisplayBasicQuestionList.Value = Session["bDisplayQuestionList"].ToString(); } this.ConstructQuestionGroupTree(); if (Session["SelectedNodeForRecover"] != null) { HiddenForNode.Value = Session["SelectedNodeForRecover"].ToString(); ConstructBasicQuestionList(); } HF_CaseID.Value = usi.CaseID; } AddnewtbServer.ServerClick += new EventHandler(AddnewtbServer_ServerClick); ConstructBasicQuestionList(); // 防止基本題目表Function在點擊內部的button後消失 老詹 2014/10/22 sCallBackFunctionInvocation = ClientScript.GetCallbackEventReference(this, "message", "show_callback", null); if (Session["SelectedGroupForRecover"] != null) { string strTmp = Session["SelectedGroupForRecover"].ToString(); Label lbSelectedQuesGroup = (Label)this.FindControl(strTmp); if (lbSelectedQuesGroup != null) { lbSelectedQuesGroup.BackColor = Color.Pink; Lb_CurrentSelected.Text = "目前選擇的問題主題:<span style='color:red;'>" + lbSelectedQuesGroup.Text + "</span>"; strCurrentQuestionRowID.Value = lbSelectedQuesGroup.ID; btSubmit.Disabled = false; btSubmit.Attributes.Add("class", "button_continue"); } } else { Lb_CurrentSelected.Text = ""; strCurrentQuestionRowID.Value = ""; btSubmit.Disabled = true; btSubmit.Attributes.Add("class", "button_gray"); } }
protected void Page_Load(object sender, EventArgs e) { if (!this.IsPostBack) { ClientScript.GetCallbackEventReference(this, "", "", ""); if (this.Befor_Load_Tags()) { Bind_ReadTag_17240_5(); Bind_ListTag_24413_1(); Bind_ListTag_57656_9(); } } }
protected void Page_Load(object sender, EventArgs e) { if (!this.IsPostBack) { ClientScript.GetCallbackEventReference(this, "", "", ""); if (this.Befor_Load_Tags()) { Bind_ReadTag_31997_6(); Bind_ListTag_7319_8(); Load_LabelTag_16598_3(); } } }
protected void Page_Load(object sender, EventArgs e) { if (!this.IsPostBack) { ClientScript.GetCallbackEventReference(this, "", "", ""); if (this.Befor_Load_Tags()) { Bind_ListTag_39334_7(); Bind_ListTag_31448_11(); Load_LabelTag_1699_4(); } } }
protected void Page_Load(object sender, EventArgs e) { if (!this.IsPostBack) { ClientScript.GetCallbackEventReference(this, "", "", ""); if (this.Befor_Load_Tags()) { Bind_ReadTag_22865_4(); Bind_ReadTag_48169_17(); Bind_ListTag_68898_15(); Load_LabelTag_16274_5(); } } }
protected void Page_Load(object sender, EventArgs e) { if (!this.IsPostBack) { ClientScript.GetCallbackEventReference(this, "", "", ""); if (this.Befor_Load_Tags()) { Bind_ReadTag_30642_5(); Bind_ReadTag_30170_9(); Bind_ListTag_71587_20(); Bind_ListTag_55453_23(); Load_LabelTag_16164_6(); } } }
protected void Page_Load(object sender, EventArgs e) { //創造題庫樹 this.ConstructQuestionGroupTree(); //回傳點選的Node sCallBackFunctionInvocation = ClientScript.GetCallbackEventReference(this, "message", "show_callback", null); Ajax.Utility.RegisterTypeForAjax(typeof(AuthoringTool_CaseEditor_Paper_Default)); //初始化lsbFeatureItem btn_Edit.Attributes.Add("onclick", "return showEditWindow()"); if (IsPostBack) { } }
/// <summary> /// Handles the Load event of the Page control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> protected void Page_Load(object sender, EventArgs e) { ClientScript.GetCallbackEventReference(this, "arg", "callback", "context"); btnSend.Click += new EventHandler(btnSend_Click); if (!Page.IsPostBack) { txtSubject.Text = Request.QueryString["subject"]; txtName.Text = Request.QueryString["name"]; txtEmail.Text = Request.QueryString["email"]; GetCookie(); phAttachment.Visible = BlogSettings.Instance.EnableContactAttachments; InititializeCaptcha(); SetFocus(); } Page.Title = Server.HtmlEncode(Resources.labels.contact); base.AddMetaTag("description", _Regex.Replace(BlogSettings.Instance.ContactFormMessage, string.Empty)); }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); if (!IsPostBack) { Callback = ClientScript.GetCallbackEventReference(this, "args", "processCallback", "context"); if (Theme == "redmond") { imageBtnURL = "images/index/imageBtn.png"; } if (Theme == "lightness") { imageBtnURL = "images/index/imageBtn1.png"; } if (Theme == "smoothness") { imageBtnURL = "images/index/imageBtn2.png"; } } }
private void LoadSettings() { pageId = WebUtils.ParseInt32FromQueryString("pageid", pageId); moduleId = WebUtils.ParseInt32FromQueryString("mid", moduleId); pageNumber = WebUtils.ParseInt32FromQueryString("pagenumber", 1); if ((moduleId > -1) && (this.CurrentPage.ContainsModule(moduleId))) { Module m = new Module(moduleId); moduleGuid = m.ModuleGuid; moduleSettings = ModuleSettings.GetModuleSettings(moduleId); pageSize = WebUtils.ParseInt32FromHashtable(moduleSettings, "ContactFormMessageListPageSizeSetting", pageSize); } sCallBackFunctionInvocation = ClientScript.GetCallbackEventReference(this, "messageGuid", "ShowMessage", "context", "OnError", true); SetupScript(); }
protected void Page_Load(object sender, EventArgs e) { if (!this.IsPostBack) { ClientScript.GetCallbackEventReference(this, "", "", ""); if (this.Befor_Load_Tags()) { Bind_ListTag_26267_6(); Bind_ListTag_41661_11(); Bind_ListTag_54198_12(); Bind_ListTag_77390_13(); Bind_ListTag_66818_14(); Bind_ListTag_89134_15(); Bind_ListTag_60327_16(); Bind_ListTag_20544_17(); Bind_ListTag_76903_21(); Bind_ListTag_107813_22(); Bind_ListTag_22342_23(); Load_LabelTag_16623_3(); } } }
protected void Page_Load(object sender, EventArgs e) { if (!this.IsPostBack) { ClientScript.GetCallbackEventReference(this, "", "", ""); if (this.Befor_Load_Tags()) { if ((Request.QueryString["kwd"] == "22") && (Request.QueryString["kwd"] == "2") && (Request.QueryString["xx"] == "oo")) { Bind_ListTag_20120_4(); } Bind_ListTag_2689_6(); Bind_ListTag_37442_10(); if ((Request.QueryString["kwd"] == "22") && (Request.QueryString["kwd"] == "2")) { Load_LabelTag_15479_3(); } } } }
/// <summary> /// Page load. /// </summary> protected void Page_Load(object sender, EventArgs e) { ScriptHelper.RegisterScriptFile(this, @"~/CMSModules/Content/CMSDesk/View/Listing.js"); currentSiteName = CMSContext.CurrentSiteName; currentUserInfo = CMSContext.CurrentUser; // Current Node ID nodeId = QueryHelper.GetInteger("nodeid", 0); // Setup page title text and image CurrentMaster.Title.TitleText = GetString("Content.ListingTitle"); CurrentMaster.Title.TitleImage = GetImageUrl("CMSModules/CMS_Content/Menu/Listing.png"); CurrentMaster.Title.HelpName = "helpTopic"; CurrentMaster.Title.HelpTopicName = "list_tab"; string[,] actions = new string[1, 6]; actions[0, 0] = HeaderActions.TYPE_HYPERLINK; actions[0, 1] = GetString("Listing.ParentDirectory"); actions[0, 5] = GetImageUrl("CMSModules/CMS_Content/Listing/parent.png"); CurrentMaster.HeaderActions.Actions = actions; if (nodeId > 0) { tree = new TreeProvider(currentUserInfo); checkPermissions = tree.CheckDocumentUIPermissions(currentSiteName); node = tree.SelectSingleNode(nodeId, TreeProvider.ALL_CULTURES); // Set edited document EditedDocument = node; if (node != null) { if (currentUserInfo.IsAuthorizedPerDocument(node, NodePermissionsEnum.ExploreTree) != AuthorizationResultEnum.Allowed) { RedirectToCMSDeskAccessDenied("CMS.Content", "exploretree"); } aliasPath = node.NodeAliasPath; // Setup the link to the parent document if ((node.NodeClassName.ToLower() != "cms.root") && (currentUserInfo.UserStartingAliasPath.ToLower() != node.NodeAliasPath.ToLower())) { CurrentMaster.HeaderActions.Actions[0, 3] = "javascript:SelectItem(" + node.NodeParentID + ");"; } else { CurrentMaster.HeaderActions.Visible = false; CurrentMaster.PanelBody.FindControl("pnlActions").Visible = false; } } ScriptHelper.RegisterProgress(this); ScriptHelper.RegisterDialogScript(this); ScriptHelper.RegisterJQuery(this); InitDropdowLists(); cultureElem.DropDownCultures.Width = 222; // Prepare JavaScript for actions StringBuilder actionScript = new StringBuilder(); actionScript.Append( @"function PerformAction(selectionFunction, selectionField, dropId){ var label = document.getElementById('" + lblInfo.ClientID + @"'); var whatDrp = document.getElementById('" + drpWhat.ClientID + @"'); var action = document.getElementById(dropId).value; var selectionFieldElem = document.getElementById(selectionField); var allSelected = " + (int)What.SelectedDocuments + @"; if (action == '" + (int)Action.SelectAction + @"'){ label.innerHTML = '" + GetString("massaction.selectsomeaction") + @"'; return false; } if(whatDrp.value == '" + (int)What.AllDocuments + @"'){ allSelected = " + (int)What.AllDocuments + @"; } var items = selectionFieldElem.value; if(!eval(selectionFunction) || whatDrp.value == '" + (int)What.AllDocuments + @"'){ var argument = '|' + allSelected + '|' + items; switch(action){ case '" + (int)Action.Move + @"': argument = '" + Action.Move + "' + argument;" + ClientScript.GetCallbackEventReference(this, "argument", "OpenModal", string.Empty) + @"; break; case '" + (int)Action.Copy + @"': argument = '" + Action.Copy + "' + argument;" + ClientScript.GetCallbackEventReference(this, "argument", "OpenModal", string.Empty) + @"; break; case '" + (int)Action.Link + @"': argument = '" + Action.Link + "' + argument;" + ClientScript.GetCallbackEventReference(this, "argument", "OpenModal", string.Empty) + @"; break; case '" + (int)Action.Delete + @"': argument = '" + Action.Delete + "' + argument;" + ClientScript.GetCallbackEventReference(this, "argument", "Redirect", string.Empty) + @"; break; case '" + (int)Action.Publish + @"': argument = '" + Action.Publish + "' + argument;" + ClientScript.GetCallbackEventReference(this, "argument", "Redirect", string.Empty) + @"; break; case '" + (int)Action.Archive + @"': argument = '" + Action.Archive + "' + argument;" + ClientScript.GetCallbackEventReference(this, "argument", "Redirect", string.Empty) + @"; break; default: return false; } } else{ label.innerHTML = '" + GetString("documents.selectdocuments") + @"'; } return false; } function OpenModal(arg, context){ modalDialog(arg,'actionDialog','90%', '85%'); } function Redirect(arg, context){ document.location.replace(arg); }"); ScriptHelper.RegisterClientScriptBlock(this, typeof(string), "actionScript", ScriptHelper.GetScript(actionScript.ToString())); // Add action to button btnOk.OnClientClick = "return PerformAction('" + gridDocuments.GetCheckSelectionScript() + "','" + gridDocuments.GetSelectionFieldClientID() + "','" + drpAction.ClientID + "');"; // Initialize dropdown lists if (!RequestHelper.IsPostBack()) { drpAction.Items.Add(new ListItem(GetString("general." + Action.SelectAction), Convert.ToInt32(Action.SelectAction).ToString())); drpAction.Items.Add(new ListItem(GetString("general." + Action.Move), Convert.ToInt32(Action.Move).ToString())); drpAction.Items.Add(new ListItem(GetString("general." + Action.Copy), Convert.ToInt32(Action.Copy).ToString())); drpAction.Items.Add(new ListItem(GetString("general." + Action.Link), Convert.ToInt32(Action.Link).ToString())); drpAction.Items.Add(new ListItem(GetString("general." + Action.Delete), Convert.ToInt32(Action.Delete).ToString())); if (currentUserInfo.IsGlobalAdministrator || currentUserInfo.IsAuthorizedPerResource("CMS.Content", "ManageWorkflow")) { drpAction.Items.Add(new ListItem(GetString("general." + Action.Publish), Convert.ToInt32(Action.Publish).ToString())); drpAction.Items.Add(new ListItem(GetString("general." + Action.Archive), Convert.ToInt32(Action.Archive).ToString())); } drpWhat.Items.Add(new ListItem(GetString("contentlisting." + What.SelectedDocuments), Convert.ToInt32(What.SelectedDocuments).ToString())); drpWhat.Items.Add(new ListItem(GetString("contentlisting." + What.AllDocuments), Convert.ToInt32(What.AllDocuments).ToString())); } // Setup the grid gridDocuments.OnExternalDataBound += gridDocuments_OnExternalDataBound; gridDocuments.OnBeforeDataReload += gridDocuments_OnBeforeDataReload; gridDocuments.OnDataReload += gridDocuments_OnDataReload; gridDocuments.ZeroRowsText = GetString("content.nochilddocumentsfound"); gridDocuments.ShowActionsMenu = true; if (node != null) { gridDocuments.WhereCondition = "NodeParentID = " + node.NodeID + " AND NodeLevel = " + (node.NodeLevel + 1); } // Initialize columns string columns = @"DocumentLastVersionName, DocumentName, NodeParentID, ClassDisplayName, DocumentModifiedWhen, Published, DocumentLastVersionNumber, DocumentMenuRedirectURL, DocumentLastVersionMenuRedirectUrl, DocumentIsArchived, DocumentCheckedOutByUserID, DocumentPublishedVersionHistoryID, DocumentWorkflowStepID, DocumentCheckedOutVersionHistoryID, DocumentNamePath, DocumentPublishFrom, DocumentType, DocumentLastVersionType, NodeAliasPath"; if (checkPermissions) { columns = SqlHelperClass.MergeColumns(columns, TreeProvider.SECURITYCHECK_REQUIRED_COLUMNS); } gridDocuments.Columns = columns; StringBuilder refreshScripts = new StringBuilder(); refreshScripts.Append( @"function RefreshTree() { if((parent != null) && (parent.parent != null) && (parent.parent.frames['contenttree'] != null) && (parent.parent.frames['contenttree'].RefreshNode != null)) { parent.parent.frames['contenttree'].RefreshNode(", nodeId, @",", nodeId, @"); } } function ClearSelection() { ", gridDocuments.GetClearSelectionScript(), @" } function RefreshGrid() { ClearSelection(); RefreshTree();", ClientScript.GetPostBackEventReference(btnShow, "null"), @" }"); // Register refresh scripts string refreshScript = ScriptHelper.GetScript(refreshScripts.ToString()); ScriptHelper.RegisterClientScriptBlock(Page, typeof(string), "refreshListing", refreshScript); // Get all possible columns to retrieve IDataClass nodeClass = DataClassFactory.NewDataClass("CMS.Tree"); DocumentInfo di = new DocumentInfo(); gridDocuments.AllColumns = SqlHelperClass.MergeColumns(SqlHelperClass.MergeColumns(di.ColumnNames.ToArray()), SqlHelperClass.MergeColumns(nodeClass.ColumnNames.ToArray())); } }
protected void Page_Load(object sender, EventArgs e) { cMsg = (Mensajes.msgBox) this.Master.FindControl("MsgBox1"); if (!ClientScript.IsClientScriptBlockRegistered("TransaccionEnCurso")) { string cbReference = ClientScript.GetCallbackEventReference(this, "arg", "GetTransactionStatus", "context", "ClientCallbackError", true); string callbackScript = "function CallServerTransaction(arg, context) {" + cbReference + "; }"; ClientScript.RegisterStartupScript(this.GetType(), "TransaccionEnCurso", callbackScript, true); // RegisterClientScriptBlock(this.GetType(), "TransaccionEnCurso", callbackScript, true); //this.RegisterClientScriptBlock("TransaccionEnCurso", callbackScript); } if (CallbackCompletado == null) { CallbackCompletado = new AsyncCallback(OnCallBackCompleted); } if (Context.Session != null) { if (Session.IsNewSession) { //Si se ha creado una nueva sesión, cuando la sesión ya estaba iniciado porque se ha conmutado de servidor string cookieHeader = Request.Headers["Cookie"]; if ((null != cookieHeader) && (cookieHeader.IndexOf("ASP.NET_SessionId") >= 0)) { Session.Abandon(); ScriptManager.RegisterStartupScript(this, typeof(Page), "redirect", "<Script language = 'Javascript'> window.parent.location='../Login.aspx' ; </Script>", false); /* * string striframe = Request.QueryString["iframe"]; * * * if (!string.IsNullOrEmpty(striframe) && striframe.Equals("true")) * { * //Si estamos dentro del frame del wizard * //Se abandona la sesión y se va a la página de login * Session.Abandon(); * * ScriptManager.RegisterStartupScript(this, typeof(Page), "redirect", "<Script language = 'Javascript'> window.parent.location='../Login.aspx' ; </Script>", false); * * } * else * { * //Si la página está dentro de una pantalla de la Web de configuración * //Se va a la página de login * //Response.Redirect("~/Login.aspx", true); * Session.Abandon(); * ScriptManager.RegisterStartupScript(this, typeof(Page), "redirect", "<Script language = 'Javascript'> window.parent.location='../Login.aspx' ; </Script>", false); * } * */ return; } } } if (!IsPostBack) { //Se lee el parámetro iframe para conocer si la pantalla se está invocando desde el Wizard (iframe=true) o desde las pantallas de configuración // para poder activar la cabecera y el árbol con la lista de opciones correspondiente // Wizard --> DivWizard (lista de botones de cada paso) // Configuración --> DivArbol (árbol del menú), DivCabecera --> cabecera de la pantalla. string striframe = Request.QueryString["iframe"]; if (!string.IsNullOrEmpty(striframe) && striframe.Equals("true")) { // Se está invocando desde el Wizard //Se ocultan la cabecera y el árbol de la pagina de configuración Control division = this.Master.FindControl("DivArbol"); if (division != null && division.Visible) { division.Visible = false; } division = this.Master.FindControl("DivCabecera"); if (division != null && division.Visible) { division.Visible = false; } //Se hace visible el arbol de menú del Wizard. El div de la cabecera del Wizard no es necesario //porque no está definido en la pagina base CD40.master, sino está en la misma página del wizard division = this.Master.FindControl("DivWizard"); if (division != null && !division.Visible) { division.Visible = true; } } else { // Se está invocando desde la pagina de configuracion //Se oculta el árbol del Wizard Control division = this.Master.FindControl("DivWizard"); if (division != null && division.Visible) { division.Visible = false; } //Se hace visible la cabecera y el arbol de menú de configuración division = this.Master.FindControl("DivArbol"); if (division != null && !division.Visible) { division.Visible = true; } division = this.Master.FindControl("DivCabecera"); if (division != null && !division.Visible) { division.Visible = true; } } bSactaActivoEnCnf = bSistemaConSactaHabilitadoPorCnf(); bVisualizandoActiva = false; } }
private void ClientInitial() { txtSRegisterDate.Text = DateTime.Now.ToString("yyyy年MM月dd日"); ClientCallback = ClientScript.GetCallbackEventReference(this, "argument", "processCallback", "null"); }
protected void Page_Load(object sender, EventArgs e) { ScriptHelper.RegisterProgress(this); if (!RequestHelper.IsPostBack()) { chkWebParts.Checked = PortalHelper.DisplayContentInDesignMode; } chkWebParts.Attributes.Add("onclick", "SaveSettings()"); chkWebParts.Text = GetString("EditTabs.DisplayContent"); string scripts = @" function SetTabsContext(mode) { if ((mode == 'design') || (mode == 'wireframe')) { document.getElementById('divDesign').style.display = 'block'; } else { document.getElementById('divDesign').style.display = 'none'; } parent.SetSelectedMode(mode); } function RefreshContent() { parent.frames['contenteditview'].document.location.replace(parent.frames['contenteditview'].document.location); } function SaveSettings() { __theFormPostData = ''; WebForm_InitCallback(); " + ClientScript.GetCallbackEventReference(this, "'save'", "RefreshContent", null) + @"; }"; ScriptHelper.RegisterClientScriptBlock(this, typeof(string), "editTabsScripts", scripts, true); // Initialize tabs tabsModes.OnTabCreated += tabModes_OnTabCreated; tabsModes.OnCheckTabSecurity += tabsModes_OnCheckTabSecurity; tabsModes.SelectedTab = 0; tabsModes.UrlTarget = "contenteditview"; // Process the page mode currentUser = CMSContext.CurrentUser; if (Node != null) { // Product tab showProductTab = Node.HasSKU; // Initialize required variables authorizedPerDesign = currentUser.IsAuthorizedPerResource("CMS.Design", "Design"); isWireframe = Node.IsWireframe(); hasWireframe = isWireframe || (Node.NodeWireframeTemplateID > 0); // Get page template information try { PageInfo pi = PageInfoProvider.GetPageInfo(CMSContext.CurrentSiteName, Node.NodeAliasPath, Node.DocumentCulture, Node.DocumentUrlPath, false); if ((pi != null) && (pi.DesignPageTemplateInfo != null)) { PageTemplateInfo pti = pi.DesignPageTemplateInfo; isPortalPage = pti.IsPortal; isMasterPage = isPortalPage && ((Node.NodeAliasPath == "/") || pti.ShowAsMasterTemplate); designEnabled = ((pti.PageTemplateType == PageTemplateTypeEnum.Portal) || (pti.PageTemplateType == PageTemplateTypeEnum.AspxPortal)); } } catch { // Page info not found - probably tried to display document from different site } // Do not show design tab for CMS.File if (Node.NodeClassName.EqualsCSafe("CMS.File", true)) { designEnabled = false; } } }
protected void Page_Load(object sender, EventArgs e) { this.initPage(); if (usi.UsingSystem == "") { usi.UsingSystem = "HINTS"; } if (!this.IsPostBack) { //畫面開始先隱藏主要Panel 朱君2012/10/24 Panel1.Visible = false; //畫面開始先隱藏主要Pane2 老詹2015/05/26 Panel2.Visible = false; //初始化ddlSelectQuestion下拉式選單 setddlSelectQuestion(); /* 教授要求非對應課程也能選其他題庫 所以先註解 * //編輯考卷 檢查若在上課且有題庫對應到上課名稱將直接導至題庫頁面 * if (strModifyType == "Paper" && strPresentType == "Edit") * { * //如果正在上課會取得CourseID 否則為空 * string strCourseID = CheckClassState(); * //如果正在上課會檢查課程有無再題庫中 * if (!strCourseID.Equals("")) * { * //取得課程名稱 * string strCourseName = clsEditGroup.ORCS_ClassGroup_SELECT_by_ClassGroupID(strCourseID).Rows[0]["cClassGroupName"].ToString(); * //取得所有題庫ID * List<string> QuestionbankIDs = new List<string>(); * DataTable dtSelectQuestion = new DataTable(); * if (Request.QueryString["Career"] != null && Request.QueryString["Career"].ToString() != "") * { * string strSQL_SelectQuestion = "SELECT * FROM QuestionList ORDER BY qId"; * dtSelectQuestion = hintsDB.getDataSet(strSQL_SelectQuestion).Tables[0]; * } * else * { * string strSQL_SelectQuestion = "SELECT * FROM QuestionList WHERE qId!='25' ORDER BY qId"; * dtSelectQuestion = hintsDB.getDataSet(strSQL_SelectQuestion).Tables[0]; * } * //紀錄所有題庫ID * for (int i = 0; i < dtSelectQuestion.Rows.Count; i++) * { * QuestionbankIDs.Add(dtSelectQuestion.Rows[i]["qId"].ToString()); * } * * foreach(string strQuestionbankID in QuestionbankIDs) * { * //取得題庫底下節點資料 * string strSQL_NodeID = "SELECT * FROM QuestionGroupTree WHERE qId LIKE '" + strQuestionbankID + "'"; * DataTable dtNodeData = hintsDB.getDataSet(strSQL_NodeID).Tables[0]; * if(dtNodeData.Rows.Count > 0) * { * foreach(DataRow drNodeData in dtNodeData.Rows) * { * //如果題庫名稱符合課程名稱跳過此頁面直接導向該題庫 * if(strCourseName.IndexOf(drNodeData["cNodeName"].ToString()) != -1) * { * string nextPage = "../Paper_SelectQuestion.aspx?GroupID=" + drNodeData["cNodeID"].ToString() + "&SearchMode=Group&cCourseID=" + strCourseID; * Response.Redirect(nextPage); * } * } * } * } * } * } */ //若Career參數有值,則選單預設職業問答樹選項 老詹 2015/06/27 if (Request.QueryString["Career"] != null && Request.QueryString["Career"].ToString() != "") { hf_Career.Value = Request.QueryString["Career"].ToString(); if (Request.QueryString["SelectedGroup"] != null) { Session["SelectedGroupForRecover"] = Request.QueryString["SelectedGroup"].ToString(); } ddlSelectQuestion.SelectedIndex = 5; SetSelectQuestion(); } } string selectNodeID = ""; if (Session["QuestionBankID"] != null) { selectNodeID = Session["QuestionBankID"].ToString(); if (tvQuestionGroup.Nodes.Count > 0) { foreach (TreeNode tnnode in tvQuestionGroup.Nodes) { SearchNode(tnnode, selectNodeID); } } } sCallBackFunctionInvocation = ClientScript.GetCallbackEventReference(this, "message", "show_callback", null); Ajax.Utility.RegisterTypeForAjax(typeof(AuthoringTool_CaseEditor_Paper_QuestionGroupTree_QGroupTreeNew)); }
protected override void OnPreInit(EventArgs e) { ClientScript.GetCallbackEventReference(this, "", "", "", false); base.OnPreInit(e); }
/// <summary> /// Raises the <see cref="E:System.Web.UI.Page.PreLoad"></see> event after postback data is loaded into the page server controls but before the <see cref="M:System.Web.UI.Control.OnLoad(System.EventArgs)"></see> event. /// </summary> /// <param name="e">An <see cref="T:System.EventArgs"></see> that contains the event data.</param> protected override void OnPreLoad(EventArgs e) { base.OnPreLoad(e); if (EnableAjaxCallback) { string clientAjaxScriptBlock = string.Concat( "<script language=\"javascript\" type=\"text/javascript\">\r\n", " var Ajax = new Object;\r\n", " Ajax.DoUpdate = function(content, outputAndOnComplete)\r\n", " {\r\n", " var output = outputAndOnComplete.split('|')[0] == 'null' ? null : outputAndOnComplete.split('|')[0]; \r\n", " var onComplete = outputAndOnComplete.split('|')[1] == 'null' ? null : outputAndOnComplete.split('|')[1]; \r\n", " if (document.getElementById(output).innerHTML != undefined) \r\n", " { \r\n", " document.getElementById(output).innerHTML = content; \r\n", " for (var i = 0; i < document.getElementById(output).childNodes.length; i++)\r\n", " {\r\n", " if (document.getElementById(output).childNodes.item(i).tagName && document.getElementById(output).childNodes.item(i).tagName == 'SCRIPT')\r\n", " {\r\n", " var oScriptNode = document.createElement('script');\r\n", " oScriptNode.text = document.getElementById(output).childNodes.item(i).text;\r\n", " oScriptNode.language = document.getElementById(output).childNodes.item(i).language;\r\n", " oScriptNode.type = document.getElementById(output).childNodes.item(i).type;\r\n", " oScriptNode.src = document.getElementById(output).childNodes.item(i).src;\r\n", " document.body.appendChild(oScriptNode);\r\n", " }\r\n", " }\r\n", " }\r\n", " if (onComplete != null) eval(onComplete)(content);\r\n", " };\r\n", " Ajax.Callback = function(ajaxTemplate, params, onComplete)\r\n", " {\r\n", " " + ClientScript.GetCallbackEventReference(this, "'AjaxTemplate=' + ajaxTemplate + '&' + params", "onComplete != null && onComplete != '' ? eval(onComplete) : null", null) + "\r\n", " };\r\n", " Ajax.Update = function(ajaxTemplate, output, params, onComplete)\r\n", " {\r\n", " " + ClientScript.GetCallbackEventReference(this, "'AjaxTemplate=' + ajaxTemplate + '&' + params", "Ajax.DoUpdate", "(output == null || output == '' ? 'null' : output) + '|' + (onComplete == null || onComplete == '' ? 'null' : onComplete)") + "\r\n", " };\r\n", " Ajax.Params = new Array();\r\n", " //parse ajax params after '#' in the url to Ajax.Params\r\n", " var _paramStr = new String(window.location.href);\r\n", " var _sharpPos = _paramStr.indexOf('#');\r\n", " if (_sharpPos >= 0 && _sharpPos < _paramStr.length - 1)\r\n", " {\r\n", " _paramStr = _paramStr.substring(_sharpPos + 1, _paramStr.length);\r\n", " }\r\n", " else\r\n", " {\r\n", " _paramStr = '';\r\n", " }\r\n", " if (_paramStr.length > 0)\r\n", " {\r\n", " var _paramArr = _paramStr.split('&');\r\n", " for (var i = 0; i < _paramArr.length; i++)\r\n", " {\r\n", " if (_paramArr[i].indexOf('=') >= 0)\r\n", " {\r\n", " var _paramKeyVal = _paramArr[i].split('=');\r\n", " Ajax.Params[_paramKeyVal[0]] = _paramKeyVal[1];\r\n", " }\r\n", " else\r\n", " {\r\n", " Ajax.Params[_paramArr[i]] = _paramArr[i];\r\n", " }\r\n", " }\r\n", " }\r\n", " Ajax.Params.toString = function()\r\n", " {\r\n", " var _retStr = _paramStr;\r\n", " var _andPos = _retStr.indexOf('&');\r\n", " if (_andPos > 0 && _andPos != _retStr.length)\r\n", " {\r\n", " _retStr = _retStr.substring(_andPos + 1, _retStr.length);\r\n", " }\r\n", " _andPos = _retStr.indexOf('&');\r\n", " if (_andPos > 0 && _andPos != _retStr.length)\r\n", " {\r\n", " _retStr = _retStr.substring(_andPos + 1, _retStr.length);\r\n", " }\r\n", " else\r\n", " {\r\n", " _retStr = null;\r\n", " }\r\n", " return _retStr;\r\n", " };\r\n", " Ajax.SetLocation = function(ajaxTemplate, output, params, onComplete)\r\n", " {\r\n", " document.location = '#ajaxTemplate=' + ajaxTemplate + (output != null && output != '' ? '&output=' + output : '') + (onComplete != null && onComplete != '' ? '&onComplete=' + onComplete : '') + (params != null && params != '' ? '&' + params : '');\r\n", " };\r\n", " Ajax.Callback2 = function(ajaxTemplate, params, onComplete)\r\n", " {\r\n", " Ajax.SetLocation(ajaxTemplate, null, params, onComplete);\r\n", " Ajax.Callback(ajaxTemplate, params, eval(onComplete));\r\n", " };\r\n", " Ajax.Update2 = function(ajaxTemplate, output, params, onComplete)\r\n", " {\r\n", " Ajax.SetLocation(ajaxTemplate, output, params, onComplete);\r\n", " Ajax.Update(ajaxTemplate, output, params, onComplete);\r\n", " };\r\n", " Ajax.OnPageLoad = function ()\r\n", " {\r\n", " if (Ajax.Params['ajaxTemplate'] != null && Ajax.Params['ajaxTemplate'] != '')\r\n", " {\r\n", " if (Ajax.Params['output'] != null && Ajax.Params['output'] != '')\r\n", " {\r\n", " Ajax.Update(Ajax.Params['ajaxTemplate'], Ajax.Params['output'], Ajax.Params.toString(), Ajax.Params['onComplete']);\r\n", " }\r\n", " else if (Ajax.Params['onComplete'] != null && Ajax.Params['onComplete'] != '')\r\n", " {\r\n", " Ajax.Callback(Ajax.Params['ajaxTemplate'], Ajax.Params.toString(), eval(Ajax.Params['onComplete']));\r\n", " }\r\n", " }\r\n", " }; \r\n", "</script>\r\n", ""); if (!ClientScript.IsClientScriptBlockRegistered("clientAjaxScriptBlock")) { ClientScript.RegisterClientScriptBlock(typeof(string), "clientAjaxScriptBlock", clientAjaxScriptBlock); } } }
protected void Page_Load(object sender, EventArgs e) { if (!RequestHelper.IsPostBack()) { chkWebParts.Checked = PortalHelper.DisplayContentInDesignMode; } tabQuery = QueryHelper.GetString("tabspecific", null); chkWebParts.Attributes.Add("onclick", "SaveSettings()"); chkWebParts.Text = GetString("EditTabs.DisplayContent"); ltlScript.Text += ScriptHelper.GetScript("function SaveSettings() { __theFormPostData = ''; WebForm_InitCallback(); " + ClientScript.GetCallbackEventReference(this, "'save'", "RefreshContent", null) + "; }"); // Initialize tabs tabsModes.OnTabCreated += tabModes_OnTabCreated; tabsModes.SelectedTab = 0; tabsModes.UrlTarget = "contenteditview"; // Process the page mode currentUser = CMSContext.CurrentUser; // Current Node ID nodeId = QueryHelper.GetInteger("nodeid", 0); TreeProvider tree = new TreeProvider(CMSContext.CurrentUser); TreeNode node = tree.SelectSingleNode(nodeId); if (node != null) { // Product tab DataClassInfo classObj = DataClassInfoProvider.GetDataClass(node.NodeClassName); if (classObj != null) { showProductTab = SettingsKeyProvider.GetBoolValue(CMSContext.CurrentSiteName + ".ProductTabEnabled") && classObj.ClassIsProduct; } // Initialize required variables authorizedPerDesign = currentUser.IsAuthorizedPerResource("CMS.Design", "Design"); isWireframe = node.NodeClassName.Equals("CMS.Wireframe", StringComparison.InvariantCultureIgnoreCase); // Get page template information PageInfo pi = PageInfoProvider.GetPageInfo(CMSContext.CurrentSiteName, node.NodeAliasPath, node.DocumentCulture, node.DocumentUrlPath, false); if ((pi != null) && (pi.PageTemplateInfo != null)) { PageTemplateInfo pti = pi.PageTemplateInfo; isPortalPage = pti.IsPortal; isMasterPage = isPortalPage && ((node.NodeAliasPath == "/") || pti.ShowAsMasterTemplate); designEnabled = ((pti.PageTemplateType == PageTemplateTypeEnum.Portal) || (pti.PageTemplateType == PageTemplateTypeEnum.AspxPortal)); } // Do not show design tab for CMS.File if (node.NodeClassName.Equals("CMS.File", StringComparison.InvariantCultureIgnoreCase)) { designEnabled = false; } // Update view mode UpdateViewMode(ViewModeEnum.Edit); // Get the page mode currentMode = CMSContext.ViewMode; } }