首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

linkbutton指向iframe,该如何解决

2012-04-21 
linkbutton指向iframe[codeC#][/code]protected void LinkButton1_Click(object sender, EventArgs e){st

linkbutton指向iframe
[code=C#][/code] 
  protected void LinkButton1_Click(object sender, EventArgs e)
  {
  string Str = "select ClassId from Type_Class where ClassPre='200906191526456875'";
  DataSet ds = Tool.DataAccess.dataSet(Str);
  string ClassId = Server.UrlEncode(ds.Tables[0].Rows[0]["ClassId"].ToString().Trim());

  ScriptManager.RegisterStartupScript(Page,
  this.GetType(),
  "updateScript",
  "document.getElementById('ContentPage').src='WebForm2.aspx?ID='" + ClassId, true);
   
  //Label1.Text = (Master.FindControl("Repeater1").FindControl("LinkButton1") as LinkButton).Text;
  }
ContentPage为iframe的id,页面跳转不过去怎么回事?

[解决办法]

C# code
ScriptManager.RegisterStartupScript(Page,this.GetType(),"updateScript","document.getElementById('ContentPage').src='WebForm2.aspx?ID=" + ClassId+"'", true); 

热点排行