using System; using System.Web; using System.Web.UI.HtmlControls ; using System.Web.UI; /// /// ÌṩÏòÒ³ÃæÊä³ö¿Í»§¶Ë´úÂëʵÏÖÌØÊ⹦Äܵķ½·¨ /// /// /// public class JScript { public static void AlertAndRedirect(string message,string toURL) { string js = ""; HttpContext.Current.Response.Write(string.Format(js,message ,toURL)); } /// /// Ïò¿Í»§¶Ë·¢Ëͺ¯ÊýKendoPostBack(eventTarget, eventArgument) /// ·þÎñÆ÷¶Ë¿É½ÓÊÕ__EVENTTARGET,__EVENTARGUMENTµÄÖµ /// /// System.Web.UI.Page Ò»°ãΪthis public static void JscriptSender(System.Web.UI.Page page) { // page.RegisterHiddenField("__EVENTTARGET",""); // page.RegisterHiddenField("__EVENTARGUMENT",""); // string s = @" //"; // page.RegisterStartupScript("sds",s); } /// /// µ¯³öJavaScriptС´°¿Ú /// /// ´°¿ÚÐÅÏ¢ public static void Alert(string message) { message = StringUtil.DeleteUnVisibleChar(message); string js=@""; HttpContext.Current.Response.Write(js); } public static void Alert(object message) { string js=@""; HttpContext.Current.Response.Write(string.Format(js,message.ToString())); } public static void RtnRltMsgbox(object message,string strWinCtrl) { string js = @""; HttpContext.Current.Response.Write(string.Format(js,message.ToString())); } /// /// »Øµ½ÀúÊ·Ò³Ãæ /// /// -1/1 public static void GoHistory(int value) { string js=@""; HttpContext.Current.Response.Write(string.Format(js,value)); } /// /// ¹Ø±Õµ±Ç°´°¿Ú /// public static void CloseWindow() { string js=@""; HttpContext.Current.Response.Write(js); HttpContext.Current.Response.End(); } /// /// ˢи¸´°¿Ú /// public static void RefreshParent() { string js=@""; HttpContext.Current.Response.Write(js); } /// /// ¸ñʽ»¯ÎªJS¿É½âÊ͵Ä×Ö·û´® /// /// /// public static string JSStringFormat(string s) { return s.Replace("\r","\\r").Replace("\n","\\n").Replace("'","\\'").Replace("\"","\\\""); } /// /// ˢдò¿ª´°¿Ú /// public static void RefreshOpener() { string js=@""; HttpContext.Current.Response.Write(js); } /// /// ´ò¿ª´°¿Ú /// /// public static void OpenWebForm(string url) { /*¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­*/ /*ÐÞ¸ÄÈËÔ±: sxs */ /*ÐÞ¸Äʱ¼ä: 2003-4-9 */ /*ÐÞ¸ÄÄ¿µÄ: пªÒ³ÃæÈ¥µôieµÄ²Ëµ¥¡£¡£¡£ */ /*×¢ÊÍÄÚÈÝ: */ /*¿ªÊ¼*/ string js=@""; /*½áÊø*/ /*¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­*/ HttpContext.Current.Response.Write(js); } public static void OpenWebForm(string url,string name,string future) { string js=@""; HttpContext.Current.Response.Write(js); } public static void OpenWebForm(string url,string formName) { /*¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­*/ /*ÐÞ¸ÄÈËÔ±: sxs */ /*ÐÞ¸Äʱ¼ä: 2003-4-9 */ /*ÐÞ¸ÄÄ¿µÄ: пªÒ³ÃæÈ¥µôieµÄ²Ëµ¥¡£¡£¡£ */ /*×¢ÊÍÄÚÈÝ: */ /*¿ªÊ¼*/ string js=@""; /*½áÊø*/ /*¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­*/ HttpContext.Current.Response.Write(js); } /// /// º¯ÊýÃû:OpenWebForm /// ¹¦ÄÜÃèÊö:´ò¿ªWEB´°¿Ú /// ´¦ÀíÁ÷³Ì: /// Ëã·¨ÃèÊö: /// ×÷ Õß: Ëïºé±ë /// ÈÕ ÆÚ: 2003-04-29 17:00 /// ÐÞ ¸Ä: /// ÈÕ ÆÚ: /// °æ ±¾: /// /// WEB´°¿Ú /// ÊÇ·ñÈ«ÆÁÄ» public static void OpenWebForm(string url,bool isFullScreen) { string js=@""; HttpContext.Current.Response.Write(js); } /// /// תÏòUrlÖÆ¶¨µÄÒ³Ãæ /// /// public static void JavaScriptLocationHref(string url) { string js=@""; js=string.Format(js,url); HttpContext.Current.Response.Write(js); } /// /// Ö¸¶¨µÄ¿ò¼ÜÒ³Ãæ×ª»» /// /// /// public static void JavaScriptFrameHref(string FrameName,string url) { string js=@""; js = js.Replace("@obj",FrameName ); js=string.Format(js,url); HttpContext.Current.Response.Write(js); } /// ///ÖØÖÃÒ³Ãæ /// public static void JavaScriptResetPage(string strRows) { string js=@""; HttpContext.Current.Response.Write(js); } /// /// º¯ÊýÃû:JavaScriptSetCookie /// ¹¦ÄÜÃèÊö:¿Í»§¶Ë·½·¨ÉèÖÃCookie /// ×÷Õß:sxs /// ÈÕÆÚ£º2003-4-9 /// °æ±¾£º1.0 /// /// CookieÃû /// CookieÖµ public static void JavaScriptSetCookie(string strName,string strValue) { string js=@""; HttpContext.Current.Response.Write(js); } /// /// º¯ÊýÃû:GotoParentWindow /// ¹¦ÄÜÃèÊö:·µ»Ø¸¸´°¿Ú /// ´¦ÀíÁ÷³Ì: /// Ëã·¨ÃèÊö: /// ×÷ Õß: Ëïºé±ë /// ÈÕ ÆÚ: 2003-04-30 10:00 /// ÐÞ ¸Ä: /// ÈÕ ÆÚ: /// °æ ±¾: /// /// ¸¸´°¿Ú public static void GotoParentWindow(string parentWindowUrl) { string js=@""; HttpContext.Current.Response.Write(js); } /// /// º¯ÊýÃû:ReplaceParentWindow /// ¹¦ÄÜÃèÊö:Ìæ»»¸¸´°¿Ú /// ´¦ÀíÁ÷³Ì: /// Ëã·¨ÃèÊö: /// ×÷ Õß: Ëïºé±ë /// ÈÕ ÆÚ: 2003-04-30 10:00 /// ÐÞ ¸Ä: /// ÈÕ ÆÚ: /// °æ ±¾: /// /// ¸¸´°¿Ú /// ´°¿ÚÌáʾ /// ´°¿ÚÌØÕ÷²ÎÊý public static void ReplaceParentWindow(string parentWindowUrl,string caption,string future) { string js=""; if(future!=null&&future.Trim()!="") { js=@""; } else { js=@""; } HttpContext.Current.Response.Write(js); } /// /// º¯ÊýÃû:ReplaceOpenerWindow /// ¹¦ÄÜÃèÊö:Ìæ»»µ±Ç°´°ÌåµÄ´ò¿ª´°¿Ú /// ´¦ÀíÁ÷³Ì: /// Ëã·¨ÃèÊö: /// ×÷ Õß: Ëïºé±ë /// ÈÕ ÆÚ: 2003-04-30 16:00 /// ÐÞ ¸Ä: /// ÈÕ ÆÚ: /// °æ ±¾: /// /// µ±Ç°´°ÌåµÄ´ò¿ª´°¿Ú public static void ReplaceOpenerWindow(string openerWindowUrl) { string js=@""; HttpContext.Current.Response.Write(js); } /// /// º¯ÊýÃû:ReplaceOpenerParentWindow /// ¹¦ÄÜÃèÊö:Ìæ»»µ±Ç°´°ÌåµÄ´ò¿ª´°¿ÚµÄ¸¸´°¿Ú /// ´¦ÀíÁ÷³Ì: /// Ëã·¨ÃèÊö: /// ×÷ Õß: Ëïºé±ë /// ÈÕ ÆÚ: 2003-07-03 19:00 /// ÐÞ ¸Ä: /// ÈÕ ÆÚ: /// °æ ±¾: /// /// µ±Ç°´°ÌåµÄ´ò¿ª´°¿ÚµÄ¸¸´°¿Ú public static void ReplaceOpenerParentFrame(string frameName,string frameWindowUrl) { string js=@""; HttpContext.Current.Response.Write(js); } /// /// º¯ÊýÃû:ReplaceOpenerParentWindow /// ¹¦ÄÜÃèÊö:Ìæ»»µ±Ç°´°ÌåµÄ´ò¿ª´°¿ÚµÄ¸¸´°¿Ú /// ´¦ÀíÁ÷³Ì: /// Ëã·¨ÃèÊö: /// ×÷ Õß: Ëïºé±ë /// ÈÕ ÆÚ: 2003-07-03 19:00 /// ÐÞ ¸Ä: /// ÈÕ ÆÚ: /// °æ ±¾: /// /// µ±Ç°´°ÌåµÄ´ò¿ª´°¿ÚµÄ¸¸´°¿Ú public static void ReplaceOpenerParentWindow(string openerParentWindowUrl) { string js=@""; HttpContext.Current.Response.Write(js); } /// /// º¯ÊýÃû:CloseParentWindow /// ¹¦ÄÜÃèÊö:¹Ø±Õ´°¿Ú /// ´¦ÀíÁ÷³Ì: /// Ëã·¨ÃèÊö: /// ×÷ Õß: Ëïºé±ë /// ÈÕ ÆÚ: 2003-04-30 16:00 /// ÐÞ ¸Ä: /// ÈÕ ÆÚ: /// °æ ±¾: /// public static void CloseParentWindow() { string js=@""; HttpContext.Current.Response.Write(js); } public static void CloseOpenerWindow() { string js=@""; HttpContext.Current.Response.Write(js); } /// /// º¯ÊýÃû:ShowModalDialogJavascript /// ¹¦ÄÜÃèÊö:·µ»Ø´ò¿ªÄ£Ê½´°¿ÚµÄ½Å±¾ /// ´¦ÀíÁ÷³Ì: /// Ëã·¨ÃèÊö: /// ×÷ Õß: Ëïºé±ë /// ÈÕ ÆÚ: 2003-04-30 15:00 /// ÐÞ ¸Ä: /// ÈÕ ÆÚ: /// °æ ±¾: /// /// /// public static string ShowModalDialogJavascript(string webFormUrl) { string js=@""; return js; } public static string ShowModalDialogJavascript(string webFormUrl,string features) { string js=@""; return js; } /// /// º¯ÊýÃû:ShowModalDialogWindow /// ¹¦ÄÜÃèÊö:´ò¿ªÄ£Ê½´°¿Ú /// ´¦ÀíÁ÷³Ì: /// Ëã·¨ÃèÊö: /// ×÷ Õß: Ëïºé±ë /// ÈÕ ÆÚ: 2003-04-30 15:00 /// ÐÞ ¸Ä: /// ÈÕ ÆÚ: /// °æ ±¾: /// /// /// public static void ShowModalDialogWindow(string webFormUrl) { string js=ShowModalDialogJavascript(webFormUrl); HttpContext.Current.Response.Write(js); } public static void ShowModalDialogWindow(string webFormUrl,string features) { string js=ShowModalDialogJavascript(webFormUrl,features); HttpContext.Current.Response.Write(js); } public static void ShowModalDialogWindow(string webFormUrl,int width,int height,int top,int left) { string features = "dialogWidth:"+width.ToString() + "px" +";dialogHeight:" + height.ToString() + "px" +";dialogLeft:" + left.ToString() + "px" +";dialogTop:" + top.ToString() + "px" +";center:yes;help=no;resizable:no;status:no;scroll=no"; ShowModalDialogWindow(webFormUrl,features); } public static void SetHtmlElementValue(string formName,string elementName,string elementValue) { string js=@""; HttpContext.Current.Response.Write(js); } }