静思
思考中

导航

 

当子页面提交按钮后,刷新本页面的字段,有可能影响父页面的字段,这个时候往往要求刷新父页面

解决方法,在子页面提交按钮事件中增加以下语句:

   Literal lit = new Literal();
   lit.Text = @"<script type='text/javascript'>window.opener.refresh(); this.window.close();</script>";

  或  // lit.Text = @"<script type='text/javascript'>window.opener.location.href=window.opener.location.href; this.window.close();</script>";
  或  //lit.Text = @"<script type='text/javascript'>window.opener.location.reload(); this.window.close();</script>";
  this.Page.Controls.Add(lit);

 

posted on 2011-03-23 11:46  murry  阅读(906)  评论(0)    收藏  举报