当前位置: 代码迷 >> ASP.NET >> linkbutton指向iframe,该如何解决
  详细解决方案

linkbutton指向iframe,该如何解决

热度:1106   发布时间:2013-02-25 00:00:00.0
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);
  相关解决方案