RefreshTargetFrameInSamePage#region RefreshTargetFrameInSamePage
 /**//// <summary>
/// 从某一框架刷新同一页面中的任意一框架(包括自己所处的框架)
/// </summary>
public static void RefreshTargetFrameInSamePage(HttpResponse Response ,string frameName ,string targetUrl)
 {
string scripStr = string.Format("<script language =''''javascript''''> window.parent.{0}.location= ''''" ,frameName) +targetUrl + "''''";
scripStr += "</"+"script>" ;
Response.Write(scripStr) ;
}
#endregion 4.如何调用祖先页面的脚本?  CallAncestorScriptMethod#region CallAncestorScriptMethod
 /**//// <summary>
/// 调用祖先页面中的某个框架内部page的脚本 ,如果是调用祖先页面的脚本,targetFrameName传入null
/// </summary>
public static void CallAncestorScriptMethod(HttpResponse Response ,string targetPageTitle ,string targetFrameName ,string methodName ,string[] paraStrs)
 {
StringBuilder scriptString = new StringBuilder();
scriptString.Append("<script language = javascript>");
scriptString.Append("var p = window ;");
scriptString.Append(string.Format("while(p.document.title != ''''{0}'''')" ,targetPageTitle));
scriptString.Append("{");
scriptString.Append("p = p.opener ;");
scriptString.Append("}");
if(targetFrameName != null)
 {
if(paraStrs == null)
 上一页 [1] [2] [3] [4] [5] [6] 下一页 |