ASP.NET里常用的JS(12) var the_cookie = '"+strName+"="+strValue+@"' var dateeXPire = 'Tuesday, 01-Dec-2020 12:00:00 GMT'; //document.cookie = the_cookie;//写入Cookie<BR>} <BR> document.cookie = the_cookie + '; expires='+dateexpire; </script>"; HttpContext.Current.Response.Write(js); }
/// <summary> /// 函数名:GotoParentWindow /// 功能描述:返回父窗口 /// </summary> /// <param name="parentWindowUrl">父窗口</param> public static void GotoParentWindow(string parentWindowUrl) { string js=@"<Script language='JavaScript'> this.parent.location.replace('"+parentWindowUrl+"');</Script>";