protected override void OnLoad(EventArgs e) { base.OnLoad(e); //string js=CreateJs(); SaveJs(); if (!Page.ClientScript.IsClientScriptIncludeRegistered(jsName + "Include")) { Page.ClientScript.RegisterClientScriptInclude(jsName + "Include", JsSaver.GetDefualtJsUrl(jsName)); } if (!Page.ClientScript.IsStartupScriptRegistered("Init")) { string commonPanl = "document.write('<div id=\"calendarPanel\" style=\"position: absolute;visibility: hidden;z-index: 9999;background-color: #FFFFFF;border: 1px solid #CCCCCC;width:175px;font-size:12px;\"></div>');\n"; Page.ClientScript.RegisterStartupScript(this.GetType(), "Init", commonPanl, true); } string lan = "1";//语言 if (IsChinese) { lan = "0"; } string showScript = "new Calendar(" + BeginYear.ToString() + ", " + EndYear.ToString() + ", " + lan + ",'yyyy-MM-dd','" + ContorlCommon.ToColorString(CurWord) + "','" + ContorlCommon.ToColorString(CurBg) + "','" + ContorlCommon.ToColorString(SunWord) + "','" + ContorlCommon.ToColorString(SatWord) + "','" + ContorlCommon.ToColorString(TdWordLight) + "','" + ContorlCommon.ToColorString(TdWordDark) + "','" + ContorlCommon.ToColorString(TdBgOut) + "','" + ContorlCommon.ToColorString(TdBgOver) + "','" + ContorlCommon.ToColorString(TrWord) + "'" + ",'" + ContorlCommon.ToColorString(TrBg) + "','" + ContorlCommon.ToColorString(InputBorder) + "','" + ContorlCommon.ToColorString(InputBg) + "').show(this,null);"; txtValue.Attributes.Add("onclick", showScript); txtValue.Attributes.Add("readonly", "readonly"); }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); SaveJs(); if (!Page.ClientScript.IsClientScriptIncludeRegistered(jsName + "Include")) { Page.ClientScript.RegisterClientScriptInclude(jsName + "Include", JsSaver.GetDefualtJsUrl(jsName)); } }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); AutoBtnClick.SaveJs(); string key = "pagerAutoInclude"; if (!Page.ClientScript.IsClientScriptIncludeRegistered(key)) { Page.ClientScript.RegisterClientScriptInclude(key, JsSaver.GetDefualtJsUrl(AutoBtnClick.JsName)); } txtPage.Attributes.Add("onkeydown", "return onPage('" + btnGo.ClientID + "',event)"); }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); SaveJs(); if (!Page.ClientScript.IsClientScriptIncludeRegistered(jsName + "Include")) { Page.ClientScript.RegisterClientScriptInclude(jsName + "Include", JsSaver.GetDefualtJsUrl(jsName)); } instanceName = "obj" + this.ClientID;//JS类的实例名 this.Attributes.Add("onclick", instanceName + ".show()"); this.Attributes.Add("onkeydown", instanceName + ".keyPressListener(event)"); this.Attributes.Add("onkeyup", instanceName + ".onKeyUp(event)"); this.Attributes.Add("onBlur", instanceName + ".focusout(event)"); this.Attributes.Add("autocomplete", "off"); }
/// <summary> /// 引用JS文件 /// </summary> /// <param name="jsName">文件名</param> private void RegisterJS(string jsName) { if (!_curPage.ClientScript.IsClientScriptIncludeRegistered(jsName + "Include")) { _curPage.ClientScript.RegisterClientScriptInclude(jsName + "Include", JsSaver.GetDefualtJsUrl(jsName)); } }