asp.net常用javascript封装代码

using System;
asp.net常用javascript封装代码
using System.Text;
asp.net常用javascript封装代码
using System.Data;
asp.net常用javascript封装代码
using System.Configuration;
asp.net常用javascript封装代码
using System.Web;
asp.net常用javascript封装代码
using System.Web.Security;
asp.net常用javascript封装代码
using System.Web.UI;
asp.net常用javascript封装代码
using System.Web.UI.WebControls;
asp.net常用javascript封装代码
using System.Web.UI.WebControls.WebParts;
asp.net常用javascript封装代码
using System.Web.UI.HtmlControls;
asp.net常用javascript封装代码
asp.net常用javascript封装代码
namespace JScript
asp.net常用javascript封装代码asp.net常用javascript封装代码
asp.net常用javascript封装代码{
asp.net常用javascript封装代码asp.net常用javascript封装代码    
/**//// <summary>
asp.net常用javascript封装代码    
/// 提供向页面输出客户端代码实现特殊功能的方法
asp.net常用javascript封装代码    
/// </summary>
asp.net常用javascript封装代码    
/// <remarks>
asp.net常用javascript封装代码    
/// </remarks>

asp.net常用javascript封装代码
asp.net常用javascript封装代码    
public class JScript
asp.net常用javascript封装代码asp.net常用javascript封装代码    
asp.net常用javascript封装代码{
asp.net常用javascript封装代码
asp.net常用javascript封装代码asp.net常用javascript封装代码        
/**//// <summary>
asp.net常用javascript封装代码        
/// 加入收藏夹
asp.net常用javascript封装代码        
/// </summary>
asp.net常用javascript封装代码        
/// <param name="url">收藏网址</param>
asp.net常用javascript封装代码        
/// <param name="urlname">收藏网址提示</param>
asp.net常用javascript封装代码        
/// <param name="name">收藏网址名字</param>

asp.net常用javascript封装代码
asp.net常用javascript封装代码        
public static void aa(string url,string urlname,string name) 
asp.net常用javascript封装代码asp.net常用javascript封装代码        
asp.net常用javascript封装代码
asp.net常用javascript封装代码        
string js = @"<a href=# onClick=window.external.addFavorite(‘"+url+",‘"+urlname+"‘) target=_self title=‘"+urlname+"‘>"+name+"</a>  ";
asp.net常用javascript封装代码            HttpContext.Current.Response.Write(js);
asp.net常用javascript封装代码        }

asp.net常用javascript封装代码
asp.net常用javascript封装代码
asp.net常用javascript封装代码asp.net常用javascript封装代码        
/**//// <summary>
asp.net常用javascript封装代码        
/// 加载以后写自己的脚本
asp.net常用javascript封装代码        
/// </summary>
asp.net常用javascript封装代码        
/// <param name="pages"></param>
asp.net常用javascript封装代码        
/// <param name="yourJs"></param>

asp.net常用javascript封装代码        public static void ClientWrite(string yourJs)
asp.net常用javascript封装代码asp.net常用javascript封装代码        
asp.net常用javascript封装代码{
asp.net常用javascript封装代码            Page pages;
asp.net常用javascript封装代码            pages 
= HttpContext.Current.Handler as System.Web.UI.Page;
asp.net常用javascript封装代码            pages.Controls.Add(
new System.Web.UI.LiteralControl("<script language=javascript>" + yourJs + "</script>"));
asp.net常用javascript封装代码        }

asp.net常用javascript封装代码asp.net常用javascript封装代码        
/**//**/
asp.net常用javascript封装代码asp.net常用javascript封装代码        
/**//// <summary>
asp.net常用javascript封装代码        
/// 加载以前写自己的脚本
asp.net常用javascript封装代码        
/// </summary>
asp.net常用javascript封装代码        
/// <param name="pages"></param>
asp.net常用javascript封装代码        
/// <param name="yourJs"></param>

asp.net常用javascript封装代码        public static void ClientWrite2(string yourJs)
asp.net常用javascript封装代码asp.net常用javascript封装代码        
asp.net常用javascript封装代码{
asp.net常用javascript封装代码            Page pages;
asp.net常用javascript封装代码            pages 
= HttpContext.Current.Handler as System.Web.UI.Page;
asp.net常用javascript封装代码            pages.Response.Write(
"<script language=javascript>");
asp.net常用javascript封装代码            pages.Response.Write(yourJs);
asp.net常用javascript封装代码            pages.Response.Write(
" </script>");
asp.net常用javascript封装代码        }

asp.net常用javascript封装代码
asp.net常用javascript封装代码asp.net常用javascript封装代码        
/**//**/
asp.net常用javascript封装代码
asp.net常用javascript封装代码asp.net常用javascript封装代码        
/**//**/
asp.net常用javascript封装代码asp.net常用javascript封装代码        
/**//// <summary>
asp.net常用javascript封装代码        
///  窗体加载以后探出对话框
asp.net常用javascript封装代码        
///  </summary>

asp.net常用javascript封装代码        public static void Alert(string msg)
asp.net常用javascript封装代码asp.net常用javascript封装代码        
asp.net常用javascript封装代码{
asp.net常用javascript封装代码            Page pages;
asp.net常用javascript封装代码            pages 
= HttpContext.Current.Handler as System.Web.UI.Page;
asp.net常用javascript封装代码            msg 
= msg.Replace("""");
asp.net常用javascript封装代码            msg 
= msg.Replace("\"""");
asp.net常用javascript封装代码
            msg = msg.Replace("\n"@"\n").Replace("\r"@"\r").Replace("\"", @"\""");
asp.net常用javascript封装代码

asp.net常用javascript封装代码            pages.Controls.Add(
new System.Web.UI.LiteralControl("<script language=javascript>alert(‘" + msg + "‘);</script>"));
asp.net常用javascript封装代码        }

asp.net常用javascript封装代码asp.net常用javascript封装代码        
/**//**/
asp.net常用javascript封装代码asp.net常用javascript封装代码        
/**//// <summary>
asp.net常用javascript封装代码        
/// 窗体没有加载的时候如pageload的时候探出对话框
asp.net常用javascript封装代码        
/// </summary>

asp.net常用javascript封装代码        public static void Alert_none(string msg)
asp.net常用javascript封装代码asp.net常用javascript封装代码        
asp.net常用javascript封装代码{
asp.net常用javascript封装代码            Page pages;
asp.net常用javascript封装代码            pages 
= HttpContext.Current.Handler as System.Web.UI.Page;
asp.net常用javascript封装代码            msg 
= msg.Replace("""");
asp.net常用javascript封装代码            msg 
= msg.Replace("\"""");
asp.net常用javascript封装代码
            msg = msg.Replace("\n"@"\n").Replace("\r"@"\r").Replace("\"", @"\""");
asp.net常用javascript封装代码
            string retu = " alert(‘" + msg + "‘);";
asp.net常用javascript封装代码            ClientWrite2(retu);
asp.net常用javascript封装代码        }

asp.net常用javascript封装代码asp.net常用javascript封装代码        
/**//**/
asp.net常用javascript封装代码        
public static void AlertAndRedirect(string message, string toURL)
asp.net常用javascript封装代码asp.net常用javascript封装代码        
asp.net常用javascript封装代码{
asp.net常用javascript封装代码            
string js = "<script language=javascript>alert(‘{0}‘);window.location.replace(‘{1}‘)</script>";
asp.net常用javascript封装代码            HttpContext.Current.Response.Write(
string.Format(js, message, toURL));
asp.net常用javascript封装代码        }

asp.net常用javascript封装代码
asp.net常用javascript封装代码       
asp.net常用javascript封装代码asp.net常用javascript封装代码        
/**//// <summary>
asp.net常用javascript封装代码        
/// 弹出JavaScript小窗口
asp.net常用javascript封装代码        
/// </summary>
asp.net常用javascript封装代码        
/// <param name="js">窗口信息</param>

asp.net常用javascript封装代码       
asp.net常用javascript封装代码        
public static void Alert(object message)
asp.net常用javascript封装代码asp.net常用javascript封装代码        
asp.net常用javascript封装代码{
asp.net常用javascript封装代码            
string js = @"<Script language=‘JavaScript‘>
asp.net常用javascript封装代码                    alert(‘{0}‘);  
asp.net常用javascript封装代码                  </Script>
";
asp.net常用javascript封装代码            HttpContext.Current.Response.Write(
string.Format(js, message.ToString()));
asp.net常用javascript封装代码        }

asp.net常用javascript封装代码
asp.net常用javascript封装代码        
public static void RtnRltMsgbox(object message, string strWinCtrl)
asp.net常用javascript封装代码asp.net常用javascript封装代码        
asp.net常用javascript封装代码{
asp.net常用javascript封装代码            
string js = @"<Script language=‘JavaScript‘>
asp.net常用javascript封装代码                     strWinCtrl = true;
asp.net常用javascript封装代码                     strWinCtrl = if(!confirm(‘
" + message + "‘))return false;</Script>";
asp.net常用javascript封装代码            HttpContext.Current.Response.Write(
string.Format(js, message.ToString()));
asp.net常用javascript封装代码        }

asp.net常用javascript封装代码
asp.net常用javascript封装代码asp.net常用javascript封装代码        
/**//// <summary>
asp.net常用javascript封装代码        
/// 回到历史页面
asp.net常用javascript封装代码        
/// </summary>
asp.net常用javascript封装代码        
/// <param name="value">-1/1</param>

asp.net常用javascript封装代码        public static void GoHistory(int value)
asp.net常用javascript封装代码asp.net常用javascript封装代码        
asp.net常用javascript封装代码{
asp.net常用javascript封装代码            
string js = @"<Script language=‘JavaScript‘>
asp.net常用javascript封装代码                    history.go({0});  
asp.net常用javascript封装代码                  </Script>
";
asp.net常用javascript封装代码            HttpContext.Current.Response.Write(
string.Format(js, value));
asp.net常用javascript封装代码        }

asp.net常用javascript封装代码
asp.net常用javascript封装代码asp.net常用javascript封装代码        
/**//// <summary>
asp.net常用javascript封装代码        
/// 关闭当前窗口
asp.net常用javascript封装代码        
/// </summary>

asp.net常用javascript封装代码        public static void CloseWindow()
asp.net常用javascript封装代码asp.net常用javascript封装代码        
asp.net常用javascript封装代码{
asp.net常用javascript封装代码            
string js = @"<Script language=‘JavaScript‘>
asp.net常用javascript封装代码                    window.close();  
asp.net常用javascript封装代码                  </Script>
";
asp.net常用javascript封装代码            HttpContext.Current.Response.Write(js);
asp.net常用javascript封装代码            HttpContext.Current.Response.End();
asp.net常用javascript封装代码        }

asp.net常用javascript封装代码
asp.net常用javascript封装代码asp.net常用javascript封装代码        
/**//// <summary>
asp.net常用javascript封装代码        
/// 刷新本页
asp.net常用javascript封装代码        
/// </summary>

asp.net常用javascript封装代码        public static void Refreshself()
asp.net常用javascript封装代码asp.net常用javascript封装代码        
asp.net常用javascript封装代码{
asp.net常用javascript封装代码            
string js = @"<Script language=‘JavaScript‘>
asp.net常用javascript封装代码                    window.location=window.location.href;
asp.net常用javascript封装代码                  </Script>
";
asp.net常用javascript封装代码            HttpContext.Current.Response.Write(js);
asp.net常用javascript封装代码        }

asp.net常用javascript封装代码asp.net常用javascript封装代码        
/**//// <summary>
asp.net常用javascript封装代码        
/// 刷新父窗口
asp.net常用javascript封装代码        
/// </summary>

asp.net常用javascript封装代码        public static void RefreshParent(string parurl)
asp.net常用javascript封装代码asp.net常用javascript封装代码        
asp.net常用javascript封装代码{
asp.net常用javascript封装代码            
string js = @"<Script language=‘JavaScript‘>
asp.net常用javascript封装代码                  window.opener.location.reload(‘
" + parurl + "‘)</Script>";
asp.net常用javascript封装代码            HttpContext.Current.Response.Write(js);
asp.net常用javascript封装代码        }

asp.net常用javascript封装代码asp.net常用javascript封装代码        
/**//// <summary>
asp.net常用javascript封装代码        
/// 刷新父框架
asp.net常用javascript封装代码        
/// </summary>

asp.net常用javascript封装代码        public static void RefreshParentifarme(string url)
asp.net常用javascript封装代码asp.net常用javascript封装代码        
asp.net常用javascript封装代码{
asp.net常用javascript封装代码            
string js = @"<Script language=‘JavaScript‘>
asp.net常用javascript封装代码                    window.parent.location.reload(‘
"+url+"‘)</Script>";
asp.net常用javascript封装代码            HttpContext.Current.Response.Write(js);
asp.net常用javascript封装代码        }

asp.net常用javascript封装代码
asp.net常用javascript封装代码asp.net常用javascript封装代码        
/**//// <summary>
asp.net常用javascript封装代码        
/// 格式化为JS可解释的字符串
asp.net常用javascript封装代码        
/// </summary>
asp.net常用javascript封装代码        
/// <param name="s"></param>
asp.net常用javascript封装代码        
/// <returns></returns>

asp.net常用javascript封装代码        public static string JSStringFormat(string s)
asp.net常用javascript封装代码asp.net常用javascript封装代码        
asp.net常用javascript封装代码{
asp.net常用javascript封装代码            
return s.Replace("\r""\\r").Replace("\n""\\n").Replace("""\\‘").Replace("\"""\\\"");
asp.net常用javascript封装代码        }

asp.net常用javascript封装代码
asp.net常用javascript封装代码asp.net常用javascript封装代码        
/**//// <summary>
asp.net常用javascript封装代码        
/// 刷新打开窗口
asp.net常用javascript封装代码        
/// </summary>

asp.net常用javascript封装代码        public static void RefreshOpener()
asp.net常用javascript封装代码asp.net常用javascript封装代码        
asp.net常用javascript封装代码{
asp.net常用javascript封装代码            
string js = @"<Script language=‘JavaScript‘>
asp.net常用javascript封装代码                    opener.location.reload();
asp.net常用javascript封装代码                  </Script>
";
asp.net常用javascript封装代码            HttpContext.Current.Response.Write(js);
asp.net常用javascript封装代码        }

asp.net常用javascript封装代码
asp.net常用javascript封装代码
asp.net常用javascript封装代码asp.net常用javascript封装代码        
/**//// <summary>
asp.net常用javascript封装代码        
/// 打开小窗体
asp.net常用javascript封装代码        
/// </summary>
asp.net常用javascript封装代码        
/// <param name="url"></param>
asp.net常用javascript封装代码        
/// <param name="width"></param>
asp.net常用javascript封装代码        
/// <param name="height"></param>
asp.net常用javascript封装代码        
/// <param name="top"></param>
asp.net常用javascript封装代码        
/// <param name="left"></param>

asp.net常用javascript封装代码        public static void OpenLittleWindow(string url, int width, int height, int top, int left)
asp.net常用javascript封装代码asp.net常用javascript封装代码        
asp.net常用javascript封装代码{
asp.net常用javascript封装代码            
string str,js;
asp.net常用javascript封装代码            str 
= "var popup;popup=window.open(‘{url}‘,null,‘scrollbars=yes,status=no,width={width},height={height},top={top},left={left}‘);popup.opener=self.opener;self.close();";
asp.net常用javascript封装代码            str 
= str.Replace("{width}", width.ToString());
asp.net常用javascript封装代码            str 
= str.Replace("{height}", height.ToString());
asp.net常用javascript封装代码            str 
= str.Replace("{top}", top.ToString());
asp.net常用javascript封装代码            str 
= str.Replace("{left}", left.ToString());
asp.net常用javascript封装代码            str 
= str.Replace("{url}", url);
asp.net常用javascript封装代码            js 
= @"<Script language=‘JavaScript‘>"+str+" </Script>";
asp.net常用javascript封装代码            HttpContext.Current.Response.Write(js);
asp.net常用javascript封装代码        }

asp.net常用javascript封装代码
asp.net常用javascript封装代码asp.net常用javascript封装代码        
/**//**/
asp.net常用javascript封装代码
asp.net常用javascript封装代码asp.net常用javascript封装代码        
/**//// <summary>
asp.net常用javascript封装代码        
/// 打开窗口
asp.net常用javascript封装代码        
/// </summary>
asp.net常用javascript封装代码        
/// <param name="url"></param>

asp.net常用javascript封装代码        public static void OpenWebForm(string url)
asp.net常用javascript封装代码asp.net常用javascript封装代码        
asp.net常用javascript封装代码{
asp.net常用javascript封装代码asp.net常用javascript封装代码            
/**//*…………………………………………………………………………………………*/
asp.net常用javascript封装代码asp.net常用javascript封装代码            
/**//*修改目的:    新开页面去掉ie的菜单。。。                        */
asp.net常用javascript封装代码
asp.net常用javascript封装代码            
string js = @"<Script language=‘JavaScript‘>
asp.net常用javascript封装代码            //window.open(‘
" + url + @"‘);
asp.net常用javascript封装代码            window.open(‘
" + url + @"‘,‘‘,‘height=0,width=0,top=0,left=0,location=no,menubar=no,resizable=yes,scrollbars=yes,status=yes,titlebar=no,toolbar=no,directories=no‘);
asp.net常用javascript封装代码            </Script>
";
asp.net常用javascript封装代码asp.net常用javascript封装代码            
/**//*结束*/
asp.net常用javascript封装代码asp.net常用javascript封装代码            
/**//*…………………………………………………………………………………………*/
asp.net常用javascript封装代码
asp.net常用javascript封装代码
asp.net常用javascript封装代码            HttpContext.Current.Response.Write(js);
asp.net常用javascript封装代码        }

asp.net常用javascript封装代码        
public static void OpenWebForm(string url, string name, string future)
asp.net常用javascript封装代码asp.net常用javascript封装代码        
asp.net常用javascript封装代码{
asp.net常用javascript封装代码            
string js = @"<Script language=‘JavaScript‘>
asp.net常用javascript封装代码                     window.open(‘
" + url + @"‘,‘" + name + @"‘,‘" + future + @"‘)
asp.net常用javascript封装代码                  </Script>
";
asp.net常用javascript封装代码            HttpContext.Current.Response.Write(js);
asp.net常用javascript封装代码        }

asp.net常用javascript封装代码        
public static void OpenWebForm(string url, string formName)
asp.net常用javascript封装代码asp.net常用javascript封装代码        
asp.net常用javascript封装代码{
asp.net常用javascript封装代码asp.net常用javascript封装代码            
/**//*…………………………………………………………………………………………*/
asp.net常用javascript封装代码asp.net常用javascript封装代码            
/**//*修改目的:    新开页面去掉ie的菜单。。。                        */
asp.net常用javascript封装代码asp.net常用javascript封装代码            
/**//*注释内容:                                */
asp.net常用javascript封装代码asp.net常用javascript封装代码            
/**//*开始*/
asp.net常用javascript封装代码            
string js = @"<Script language=‘JavaScript‘>
asp.net常用javascript封装代码            window.open(‘
" + url + @"‘,‘" + formName + @"‘,‘height=0,width=0,top=0,left=0,location=no,menubar=no,resizable=yes,scrollbars=yes,status=yes,titlebar=no,toolbar=no,directories=no‘);
asp.net常用javascript封装代码            </Script>
";
asp.net常用javascript封装代码asp.net常用javascript封装代码            
/**//*结束*/
asp.net常用javascript封装代码asp.net常用javascript封装代码            
/**//*…………………………………………………………………………………………*/
asp.net常用javascript封装代码
asp.net常用javascript封装代码            HttpContext.Current.Response.Write(js);
asp.net常用javascript封装代码        }

asp.net常用javascript封装代码
asp.net常用javascript封装代码asp.net常用javascript封装代码        
/**//// <summary>        
asp.net常用javascript封装代码        
/// 函数名:OpenWebForm    
asp.net常用javascript封装代码        
/// 功能描述:打开WEB窗口    
asp.net常用javascript封装代码        
/// </summary>
asp.net常用javascript封装代码        
/// <param name="url">WEB窗口</param>
asp.net常用javascript封装代码        
/// <param name="isFullScreen">是否全屏幕</param>

asp.net常用javascript封装代码        public static void OpenWebForm(string url, bool isFullScreen)
asp.net常用javascript封装代码asp.net常用javascript封装代码        
asp.net常用javascript封装代码{
asp.net常用javascript封装代码            
string js = @"<Script language=‘JavaScript‘>";
asp.net常用javascript封装代码            
if (isFullScreen)
asp.net常用javascript封装代码asp.net常用javascript封装代码            
asp.net常用javascript封装代码{
asp.net常用javascript封装代码                js 
+= "var iWidth = 0;";
asp.net常用javascript封装代码                js 
+= "var iHeight = 0;";
asp.net常用javascript封装代码                js 
+= "iWidth=window.screen.availWidth-10;";
asp.net常用javascript封装代码                js 
+= "iHeight=window.screen.availHeight-50;";
asp.net常用javascript封装代码                js 
+= "var szFeatures =‘width=‘ + iWidth + ‘,height=‘ + iHeight + ‘,top=0,left=0,location=no,menubar=no,resizable=yes,scrollbars=yes,status=yes,titlebar=no,toolbar=no,directories=no‘;";
asp.net常用javascript封装代码                js 
+= "window.open(‘" + url + @"‘,‘‘,szFeatures);";
asp.net常用javascript封装代码            }

asp.net常用javascript封装代码            
else
asp.net常用javascript封装代码asp.net常用javascript封装代码            
asp.net常用javascript封装代码{
asp.net常用javascript封装代码                js 
+= "window.open(‘" + url + @"‘,‘‘,‘height=0,width=0,top=0,left=0,location=no,menubar=no,resizable=yes,scrollbars=yes,status=yes,titlebar=no,toolbar=no,directories=no‘);";
asp.net常用javascript封装代码            }

asp.net常用javascript封装代码            js 
+= "</Script>";
asp.net常用javascript封装代码            HttpContext.Current.Response.Write(js);
asp.net常用javascript封装代码        }

asp.net常用javascript封装代码
asp.net常用javascript封装代码asp.net常用javascript封装代码        
/**//// <summary>
asp.net常用javascript封装代码        
/// 转向Url制定的页面
asp.net常用javascript封装代码        
/// </summary>
asp.net常用javascript封装代码        
/// <param name="url"></param>

asp.net常用javascript封装代码        public static void JavaScriptLocationHref(string url)
asp.net常用javascript封装代码asp.net常用javascript封装代码        
asp.net常用javascript封装代码{
asp.net常用javascript封装代码            
string js = @"<Script language=‘JavaScript‘>
asp.net常用javascript封装代码                    window.location.replace(‘{0}‘);
asp.net常用javascript封装代码                  </Script>
";
asp.net常用javascript封装代码            js 
= string.Format(js, url);
asp.net常用javascript封装代码            HttpContext.Current.Response.Write(js);
asp.net常用javascript封装代码        }

asp.net常用javascript封装代码
asp.net常用javascript封装代码asp.net常用javascript封装代码        
/**//// <summary>
asp.net常用javascript封装代码        
/// 指定的框架页面转换
asp.net常用javascript封装代码        
/// </summary>
asp.net常用javascript封装代码        
/// <param name="FrameName"></param>
asp.net常用javascript封装代码        
/// <param name="url"></param>

asp.net常用javascript封装代码        public static void JavaScriptFrameHref(string FrameName, string url)
asp.net常用javascript封装代码asp.net常用javascript封装代码        
asp.net常用javascript封装代码{
asp.net常用javascript封装代码            
string js = @"<Script language=‘JavaScript‘>
asp.net常用javascript封装代码                    
asp.net常用javascript封装代码                    @obj.location.replace(""{0}"");
asp.net常用javascript封装代码                  </Script>
";
asp.net常用javascript封装代码            js 
= js.Replace("@obj", FrameName);
asp.net常用javascript封装代码            js 
= string.Format(js, url);
asp.net常用javascript封装代码            HttpContext.Current.Response.Write(js);
asp.net常用javascript封装代码        }

asp.net常用javascript封装代码
asp.net常用javascript封装代码asp.net常用javascript封装代码        
/**//// <summary>
asp.net常用javascript封装代码        
///重置页面
asp.net常用javascript封装代码        
/// </summary>

asp.net常用javascript封装代码        public static void JavaScriptResetPage(string strRows)
asp.net常用javascript封装代码asp.net常用javascript封装代码        
asp.net常用javascript封装代码{
asp.net常用javascript封装代码            
string js = @"<Script language=‘JavaScript‘>
asp.net常用javascript封装代码                    window.parent.CenterFrame.rows=‘
" + strRows + "‘;</Script>";
asp.net常用javascript封装代码            HttpContext.Current.Response.Write(js);
asp.net常用javascript封装代码        }

asp.net常用javascript封装代码
asp.net常用javascript封装代码asp.net常用javascript封装代码        
/**//// <summary>
asp.net常用javascript封装代码        
/// 函数名:JavaScriptSetCookie
asp.net常用javascript封装代码        
/// 功能描述:客户端方法设置Cookie
asp.net常用javascript封装代码        
/// </summary>
asp.net常用javascript封装代码        
/// <param name="strName">Cookie名</param>
asp.net常用javascript封装代码        
/// <param name="strValue">Cookie值</param>

asp.net常用javascript封装代码        public static void JavaScriptSetCookie(string strName, string strValue)
asp.net常用javascript封装代码asp.net常用javascript封装代码        
asp.net常用javascript封装代码{
asp.net常用javascript封装代码            
string js = @"<script language=Javascript>
asp.net常用javascript封装代码            var the_cookie = ‘
" + strName + "=" + strValue + @"
asp.net常用javascript封装代码            var dateexpire = ‘Tuesday, 01-Dec-2020 12:00:00 GMT‘;
asp.net常用javascript封装代码            //document.cookie = the_cookie;//写入Cookie<BR>} <BR>
asp.net常用javascript封装代码            document.cookie = the_cookie + ‘; expires=‘+dateexpire;            
asp.net常用javascript封装代码            </script>
";
asp.net常用javascript封装代码            HttpContext.Current.Response.Write(js);
asp.net常用javascript封装代码        }

asp.net常用javascript封装代码
asp.net常用javascript封装代码asp.net常用javascript封装代码        
/**//// <summary>        
asp.net常用javascript封装代码        
/// 函数名:GotoParentWindow    
asp.net常用javascript封装代码        
/// 功能描述:返回父窗口    
asp.net常用javascript封装代码        
/// </summary>
asp.net常用javascript封装代码        
/// <param name="parentWindowUrl">父窗口</param>        

asp.net常用javascript封装代码        public static void GotoParentWindow(string parentWindowUrl)
asp.net常用javascript封装代码asp.net常用javascript封装代码        
asp.net常用javascript封装代码{
asp.net常用javascript封装代码            
string js = @"<Script language=‘JavaScript‘>
asp.net常用javascript封装代码                    this.parent.location.replace(‘
" + parentWindowUrl + "‘);</Script>";
asp.net常用javascript封装代码            HttpContext.Current.Response.Write(js);
asp.net常用javascript封装代码        }

asp.net常用javascript封装代码
asp.net常用javascript封装代码asp.net常用javascript封装代码        
/**//// <summary>        
asp.net常用javascript封装代码        
/// 函数名:ReplaceParentWindow    
asp.net常用javascript封装代码        
/// 功能描述:替换父窗口    
asp.net常用javascript封装代码        
/// </summary>
asp.net常用javascript封装代码        
/// <param name="parentWindowUrl">父窗口</param>
asp.net常用javascript封装代码        
/// <param name="caption">窗口提示</param>
asp.net常用javascript封装代码        
/// <param name="future">窗口特征参数</param>

asp.net常用javascript封装代码        public static void ReplaceParentWindow(string parentWindowUrl, string caption, string future)
asp.net常用javascript封装代码asp.net常用javascript封装代码        
asp.net常用javascript封装代码{
asp.net常用javascript封装代码            
string js = "";
asp.net常用javascript封装代码            
if (future != null && future.Trim() != "")
asp.net常用javascript封装代码asp.net常用javascript封装代码            
asp.net常用javascript封装代码{
asp.net常用javascript封装代码                js 
= @"<script language=javascript>this.parent.location.replace(‘" + parentWindowUrl + "‘,‘" + caption + "‘,‘" + future + "‘);</script>";
asp.net常用javascript封装代码            }

asp.net常用javascript封装代码            
else
asp.net常用javascript封装代码asp.net常用javascript封装代码            
asp.net常用javascript封装代码{
asp.net常用javascript封装代码                js 
= @"<script language=javascript>var iWidth = 0 ;var iHeight = 0 ;iWidth=window.screen.availWidth-10;iHeight=window.screen.availHeight-50;
asp.net常用javascript封装代码                            var szFeatures = ‘dialogWidth:‘+iWidth+‘;dialogHeight:‘+iHeight+‘;dialogLeft:0px;dialogTop:0px;center:yes;help=no;resizable:on;status:on;scroll=yes‘;this.parent.location.replace(‘
" + parentWindowUrl + "‘,‘" + caption + "‘,szFeatures);</script>";
asp.net常用javascript封装代码            }

asp.net常用javascript封装代码
asp.net常用javascript封装代码            HttpContext.Current.Response.Write(js);
asp.net常用javascript封装代码        }

asp.net常用javascript封装代码
asp.net常用javascript封装代码asp.net常用javascript封装代码        
/**//// <summary>        
asp.net常用javascript封装代码        
/// 函数名:ReplaceOpenerWindow    
asp.net常用javascript封装代码        
/// 功能描述:替换当前窗体的打开窗口    
asp.net常用javascript封装代码        
/// </summary>
asp.net常用javascript封装代码        
/// <param name="openerWindowUrl">当前窗体的打开窗口</param>        

asp.net常用javascript封装代码        public static void ReplaceOpenerWindow(string openerWindowUrl)
asp.net常用javascript封装代码asp.net常用javascript封装代码        
asp.net常用javascript封装代码{
asp.net常用javascript封装代码            
string js = @"<Script language=‘JavaScript‘>
asp.net常用javascript封装代码                    window.opener.location.replace(‘
" + openerWindowUrl + "‘);</Script>";
asp.net常用javascript封装代码            HttpContext.Current.Response.Write(js);
asp.net常用javascript封装代码        }

asp.net常用javascript封装代码
asp.net常用javascript封装代码asp.net常用javascript封装代码        
/**//// <summary>        
asp.net常用javascript封装代码        
/// 函数名:ReplaceOpenerParentWindow    
asp.net常用javascript封装代码        
/// 功能描述:替换当前窗体的打开窗口的父窗口    
asp.net常用javascript封装代码        
/// </summary>
asp.net常用javascript封装代码        
/// <param name="openerWindowUrl">当前窗体的打开窗口的父窗口</param>        

asp.net常用javascript封装代码        public static void ReplaceOpenerParentFrame(string frameName, string frameWindowUrl)
asp.net常用javascript封装代码asp.net常用javascript封装代码        
asp.net常用javascript封装代码{
asp.net常用javascript封装代码            
string js = @"<Script language=‘JavaScript‘>
asp.net常用javascript封装代码                    window.opener.parent.
" + frameName + ".location.replace(‘" + frameWindowUrl + "‘);</Script>";
asp.net常用javascript封装代码            HttpContext.Current.Response.Write(js);
asp.net常用javascript封装代码        }

asp.net常用javascript封装代码
asp.net常用javascript封装代码asp.net常用javascript封装代码        
/**//// <summary>        
asp.net常用javascript封装代码        
/// 函数名:ReplaceOpenerParentWindow    
asp.net常用javascript封装代码        
/// 功能描述:替换当前窗体的打开窗口的父窗口    
asp.net常用javascript封装代码        
/// </summary>
asp.net常用javascript封装代码        
/// <param name="openerWindowUrl">当前窗体的打开窗口的父窗口</param>        

asp.net常用javascript封装代码        public static void ReplaceOpenerParentWindow(string openerParentWindowUrl)
asp.net常用javascript封装代码asp.net常用javascript封装代码        
asp.net常用javascript封装代码{
asp.net常用javascript封装代码            
string js = @"<Script language=‘JavaScript‘>
asp.net常用javascript封装代码                    window.opener.parent.location.replace(‘
" + openerParentWindowUrl + "‘);</Script>";
asp.net常用javascript封装代码            HttpContext.Current.Response.Write(js);
asp.net常用javascript封装代码        }

asp.net常用javascript封装代码
asp.net常用javascript封装代码asp.net常用javascript封装代码        
/**//// <summary>        
asp.net常用javascript封装代码        
/// 函数名:CloseParentWindow    
asp.net常用javascript封装代码        
/// 功能描述:关闭窗口    
asp.net常用javascript封装代码        
/// </summary>

asp.net常用javascript封装代码        public static void CloseParentWindow()
asp.net常用javascript封装代码asp.net常用javascript封装代码        
asp.net常用javascript封装代码{
asp.net常用javascript封装代码            
string js = @"<Script language=‘JavaScript‘>
asp.net常用javascript封装代码                    window.parent.close();  
asp.net常用javascript封装代码                  </Script>
";
asp.net常用javascript封装代码            HttpContext.Current.Response.Write(js);
asp.net常用javascript封装代码        }

asp.net常用javascript封装代码
asp.net常用javascript封装代码        
public static void CloseOpenerWindow()
asp.net常用javascript封装代码asp.net常用javascript封装代码        
asp.net常用javascript封装代码{
asp.net常用javascript封装代码            
string js = @"<Script language=‘JavaScript‘>
asp.net常用javascript封装代码                    window.opener.close();  
asp.net常用javascript封装代码                  </Script>
";
asp.net常用javascript封装代码            HttpContext.Current.Response.Write(js);
asp.net常用javascript封装代码        }

asp.net常用javascript封装代码
asp.net常用javascript封装代码asp.net常用javascript封装代码        
/**//// <summary>
asp.net常用javascript封装代码        
/// 函数名:ShowModalDialogJavascript    
asp.net常用javascript封装代码        
/// 功能描述:返回打开模式窗口的脚本    
asp.net常用javascript封装代码        
/// </summary>
asp.net常用javascript封装代码        
/// <param name="webFormUrl"></param>
asp.net常用javascript封装代码        
/// <returns></returns>

asp.net常用javascript封装代码        public static string ShowModalDialogJavascript(string webFormUrl)
asp.net常用javascript封装代码asp.net常用javascript封装代码        
asp.net常用javascript封装代码{
asp.net常用javascript封装代码            
string js = @"<script language=javascript>
asp.net常用javascript封装代码                            var iWidth = 0 ;
asp.net常用javascript封装代码                            var iHeight = 0 ;
asp.net常用javascript封装代码                            iWidth=window.screen.availWidth-10;
asp.net常用javascript封装代码                            iHeight=window.screen.availHeight-50;
asp.net常用javascript封装代码                            var szFeatures = ‘dialogWidth:‘+iWidth+‘;dialogHeight:‘+iHeight+‘;dialogLeft:0px;dialogTop:0px;center:yes;help=no;resizable:on;status:on;scroll=yes‘;
asp.net常用javascript封装代码                            showModalDialog(‘
" + webFormUrl + "‘,‘‘,szFeatures);</script>";
asp.net常用javascript封装代码            
return js;
asp.net常用javascript封装代码        }

asp.net常用javascript封装代码
asp.net常用javascript封装代码        
public static string ShowModalDialogJavascript(string webFormUrl, string features)
asp.net常用javascript封装代码asp.net常用javascript封装代码        
asp.net常用javascript封装代码{
asp.net常用javascript封装代码            
string js = @"<script language=javascript>                            
asp.net常用javascript封装代码                            showModalDialog(‘
" + webFormUrl + "‘,‘‘,‘" + features + "‘);</script>";
asp.net常用javascript封装代码            
return js;
asp.net常用javascript封装代码        }

asp.net常用javascript封装代码
asp.net常用javascript封装代码asp.net常用javascript封装代码        
/**//// <summary>
asp.net常用javascript封装代码        
/// 函数名:ShowModalDialogWindow    
asp.net常用javascript封装代码        
/// 功能描述:打开模式窗口    
asp.net常用javascript封装代码        
/// </summary>
asp.net常用javascript封装代码        
/// <param name="webFormUrl"></param>
asp.net常用javascript封装代码        
/// <returns></returns>

asp.net常用javascript封装代码        public static void ShowModalDialogWindow(string webFormUrl)
asp.net常用javascript封装代码asp.net常用javascript封装代码        
asp.net常用javascript封装代码{
asp.net常用javascript封装代码            
string js = ShowModalDialogJavascript(webFormUrl);
asp.net常用javascript封装代码            HttpContext.Current.Response.Write(js);
asp.net常用javascript封装代码        }

asp.net常用javascript封装代码
asp.net常用javascript封装代码        
public static void ShowModalDialogWindow(string webFormUrl, string features)
asp.net常用javascript封装代码asp.net常用javascript封装代码        
asp.net常用javascript封装代码{
asp.net常用javascript封装代码            
string js = ShowModalDialogJavascript(webFormUrl, features);
asp.net常用javascript封装代码            HttpContext.Current.Response.Write(js);
asp.net常用javascript封装代码        }

asp.net常用javascript封装代码        
public static void ShowModalDialogWindow(string webFormUrl, int width, int height, int top, int left)
asp.net常用javascript封装代码asp.net常用javascript封装代码        
asp.net常用javascript封装代码{
asp.net常用javascript封装代码            
string features = "dialogWidth:" + width.ToString() + "px"
asp.net常用javascript封装代码                
+ ";dialogHeight:" + height.ToString() + "px"
asp.net常用javascript封装代码                
+ ";dialogLeft:" + left.ToString() + "px"
asp.net常用javascript封装代码                
+ ";dialogTop:" + top.ToString() + "px"
asp.net常用javascript封装代码                
+ ";center:yes;help=no;resizable:no;status:no;scroll=no";
asp.net常用javascript封装代码            ShowModalDialogWindow(webFormUrl, features);
asp.net常用javascript封装代码        }

asp.net常用javascript封装代码
asp.net常用javascript封装代码        
public static void SetHtmlElementValue(string formName, string elementName, string elementValue)
asp.net常用javascript封装代码asp.net常用javascript封装代码        
asp.net常用javascript封装代码{
asp.net常用javascript封装代码            
string js = @"<Script language=‘JavaScript‘>if(document." + formName + "." + elementName + "!=null){document." + formName + "." + elementName + ".value =" + elementValue + ";}</Script>";
asp.net常用javascript封装代码            HttpContext.Current.Response.Write(js);
asp.net常用javascript封装代码        }

asp.net常用javascript封装代码    
asp.net常用javascript封装代码asp.net常用javascript封装代码     
/**//**/
asp.net常用javascript封装代码asp.net常用javascript封装代码    
/**//// <summary>
asp.net常用javascript封装代码    
/// 回车-〉tab
asp.net常用javascript封装代码    
/// </summary>
asp.net常用javascript封装代码    
/// <param name="page"></param>

asp.net常用javascript封装代码    public static void ToTab()
asp.net常用javascript封装代码asp.net常用javascript封装代码    
asp.net常用javascript封装代码{
asp.net常用javascript封装代码        Page page;
asp.net常用javascript封装代码        page 
= HttpContext.Current.Handler as System.Web.UI.Page;
asp.net常用javascript封装代码        System.Text.StringBuilder scriptFunction 
= new StringBuilder();
asp.net常用javascript封装代码        scriptFunction.Append(
"<script language=‘javascript‘>");
asp.net常用javascript封装代码        scriptFunction.Append(
"       function returnTotab()");
asp.net常用javascript封装代码        scriptFunction.Append(
"         {");
asp.net常用javascript封装代码        scriptFunction.Append(
"          if(event.keyCode==13)    ");
asp.net常用javascript封装代码        scriptFunction.Append(
"             {event.keyCode=9;     ");
asp.net常用javascript封装代码        scriptFunction.Append(
"               return true;}       ");
asp.net常用javascript封装代码        scriptFunction.Append(
"          } ");
asp.net常用javascript封装代码        scriptFunction.Append(
"</script>");
asp.net常用javascript封装代码        page.ClientScript.RegisterStartupScript(page.GetType(),
"totab", scriptFunction.ToString());
asp.net常用javascript封装代码
asp.net常用javascript封装代码    }

asp.net常用javascript封装代码asp.net常用javascript封装代码    
/**//**/
asp.net常用javascript封装代码asp.net常用javascript封装代码    
/**//// <summary>
asp.net常用javascript封装代码    
/// tab->enter
asp.net常用javascript封装代码    
/// </summary>
asp.net常用javascript封装代码    
/// <param name="page"></param>

asp.net常用javascript封装代码    public static void tabToEnter()
asp.net常用javascript封装代码asp.net常用javascript封装代码    
asp.net常用javascript封装代码{
asp.net常用javascript封装代码        Page page;
asp.net常用javascript封装代码        page 
= HttpContext.Current.Handler as System.Web.UI.Page;
asp.net常用javascript封装代码        System.Text.StringBuilder scriptFunction 
= new StringBuilder();
asp.net常用javascript封装代码        scriptFunction.Append(
"<script language=‘javascript‘>");
asp.net常用javascript封装代码        scriptFunction.Append(
"    function Tcheck()");
asp.net常用javascript封装代码        scriptFunction.Append(
"         {");
asp.net常用javascript封装代码        scriptFunction.Append(
"         if(event.keyCode==8||event.keyCode==9) ");
asp.net常用javascript封装代码        scriptFunction.Append(
"          return true;");
asp.net常用javascript封装代码        scriptFunction.Append(
"         else ");
asp.net常用javascript封装代码        scriptFunction.Append(
"         {");
asp.net常用javascript封装代码        scriptFunction.Append(
"          if(((event.keyCode>=48)++(event.keyCode<=57))||((event.keyCode>=96)++(event.keyCode<=105)))");
asp.net常用javascript封装代码        scriptFunction.Append(
"              return true;");
asp.net常用javascript封装代码        scriptFunction.Append(
"          else");
asp.net常用javascript封装代码        scriptFunction.Append(
"          if(event.keyCode==13||event.keyCode==110||event.keyCode==190||event.keyCode==39)");
asp.net常用javascript封装代码        scriptFunction.Append(
"             {event.keyCode=9;");
asp.net常用javascript封装代码        scriptFunction.Append(
"               return true;}");
asp.net常用javascript封装代码        scriptFunction.Append(
"            else");
asp.net常用javascript封装代码        scriptFunction.Append(
"              return false;");
asp.net常用javascript封装代码        scriptFunction.Append(
"        }");
asp.net常用javascript封装代码        scriptFunction.Append(
"          }     ");
asp.net常用javascript封装代码        scriptFunction.Append(
"</script>");
asp.net常用javascript封装代码        page.ClientScript.RegisterStartupScript(page.GetType(),
"switch", scriptFunction.ToString());
asp.net常用javascript封装代码    }

asp.net常用javascript封装代码asp.net常用javascript封装代码    
/**//**/
asp.net常用javascript封装代码asp.net常用javascript封装代码    
/**//// <summary>
asp.net常用javascript封装代码    
/// attachEvent
asp.net常用javascript封装代码    
/// </summary>
asp.net常用javascript封装代码    
/// <param name="controlToFocus"></param>
asp.net常用javascript封装代码    
/// <param name="page"></param>

asp.net常用javascript封装代码    public static void attachEvent(Control[] controlToFocus)
asp.net常用javascript封装代码asp.net常用javascript封装代码    
asp.net常用javascript封装代码{
asp.net常用javascript封装代码        Page page;
asp.net常用javascript封装代码        page 
= HttpContext.Current.Handler as System.Web.UI.Page;
asp.net常用javascript封装代码        System.Text.StringBuilder scriptFunction 
= new StringBuilder();
asp.net常用javascript封装代码        
string scriptClientId;
asp.net常用javascript封装代码        scriptFunction.Append(
"<script language=‘javascript‘>");
asp.net常用javascript封装代码
asp.net常用javascript封装代码        
foreach (Control con in controlToFocus)
asp.net常用javascript封装代码asp.net常用javascript封装代码        
asp.net常用javascript封装代码{
asp.net常用javascript封装代码            scriptClientId 
= con.ClientID;
asp.net常用javascript封装代码            scriptFunction.Append(
"document.getElementById(‘" + scriptClientId + "‘).attachEvent(‘onkeydown‘, Tcheck);");
asp.net常用javascript封装代码        }

asp.net常用javascript封装代码        scriptFunction.Append(
"</script>");
asp.net常用javascript封装代码        page.ClientScript.RegisterStartupScript(page.GetType(),
"attach", scriptFunction.ToString());
asp.net常用javascript封装代码    }

asp.net常用javascript封装代码
asp.net常用javascript封装代码
asp.net常用javascript封装代码asp.net常用javascript封装代码    
/**//**/
asp.net常用javascript封装代码asp.net常用javascript封装代码    
/**//// <summary>
asp.net常用javascript封装代码    
/// 
asp.net常用javascript封装代码    
/// </summary>
asp.net常用javascript封装代码    
/// <param name="controlToFocus"></param>
asp.net常用javascript封装代码    
/// <param name="page"></param>
asp.net常用javascript封装代码    
/// <param name="eventStr"></param>
asp.net常用javascript封装代码    
/// <param name="FuncStr"></param>

asp.net常用javascript封装代码    public static void AttachEvent(Control[] controlToFocus, string
asp.net常用javascript封装代码
asp.net常用javascript封装代码eventStr, 
string FuncStr)
asp.net常用javascript封装代码asp.net常用javascript封装代码    
asp.net常用javascript封装代码{
asp.net常用javascript封装代码        Page page;
asp.net常用javascript封装代码        page 
= HttpContext.Current.Handler as System.Web.UI.Page;
asp.net常用javascript封装代码        System.Text.StringBuilder scriptFunction 
= new StringBuilder();
asp.net常用javascript封装代码        
string scriptClientId;
asp.net常用javascript封装代码        scriptFunction.Append(
"<script language=‘javascript‘>");
asp.net常用javascript封装代码        
foreach (Control con in controlToFocus)
asp.net常用javascript封装代码asp.net常用javascript封装代码        
asp.net常用javascript封装代码{
asp.net常用javascript封装代码            scriptClientId 
= con.ClientID;
asp.net常用javascript封装代码            scriptFunction.Append(
"document.getElementById(‘" + scriptClientId + "‘).attachEvent(‘" + eventStr + "‘, " + FuncStr + ");");
asp.net常用javascript封装代码        }

asp.net常用javascript封装代码        scriptFunction.Append(
"</script>");
asp.net常用javascript封装代码        page.ClientScript.RegisterStartupScript(page.GetType(),
"attach2", scriptFunction.ToString());
asp.net常用javascript封装代码    }

asp.net常用javascript封装代码asp.net常用javascript封装代码    
/**//**/
asp.net常用javascript封装代码asp.net常用javascript封装代码    
/**//// <summary>
asp.net常用javascript封装代码    
/// 
asp.net常用javascript封装代码    
/// </summary>
asp.net常用javascript封装代码    
/// <param name="page"></param>

asp.net常用javascript封装代码        public static void NumOnlyFun()
asp.net常用javascript封装代码asp.net常用javascript封装代码        
asp.net常用javascript封装代码{
asp.net常用javascript封装代码            Page page;
asp.net常用javascript封装代码            page 
= HttpContext.Current.Handler as System.Web.UI.Page;
asp.net常用javascript封装代码            System.Text.StringBuilder scriptFunction 
= new StringBuilder();
asp.net常用javascript封装代码            scriptFunction.Append(
"<script language=‘javascript‘>");
asp.net常用javascript封装代码            scriptFunction.Append(
"       function isNum()");
asp.net常用javascript封装代码            scriptFunction.Append(
"         {");
asp.net常用javascript封装代码            scriptFunction.Append(
"              if(event.keyCode==8||event.keyCode==9) ");
asp.net常用javascript封装代码            scriptFunction.Append(
"                  return true;");
asp.net常用javascript封装代码            scriptFunction.Append(
"             else ");
asp.net常用javascript封装代码            scriptFunction.Append(
"             {");
asp.net常用javascript封装代码            scriptFunction.Append(
"          if(((event.keyCode>=48)++(event.keyCode<=57))||((event.keyCode>=96)++(event.keyCode<=105)))");
asp.net常用javascript封装代码            scriptFunction.Append(
"              return true;");
asp.net常用javascript封装代码            scriptFunction.Append(
"          else");
asp.net常用javascript封装代码            scriptFunction.Append(
"                return false;");
asp.net常用javascript封装代码            scriptFunction.Append(
"        }");
asp.net常用javascript封装代码            scriptFunction.Append(
"          } ");
asp.net常用javascript封装代码            scriptFunction.Append(
"</script>");
asp.net常用javascript封装代码            page.ClientScript.RegisterStartupScript(page.GetType(), 
"numonly", scriptFunction.ToString());
asp.net常用javascript封装代码
asp.net常用javascript封装代码        }

asp.net常用javascript封装代码    
asp.net常用javascript封装代码    }

asp.net常用javascript封装代码
asp.net常用javascript封装代码  
asp.net常用javascript封装代码
asp.net常用javascript封装代码}
 
上一篇:前端福利!这项黑科技直接从图片生成代码


下一篇:vb.net 获得版本信息