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);