我在通过 ASP.NET C# 传递 iframe 的 src 值时收到此错误。这isrc
是一个字符串变量:
Line 26: HtmlControl ifm = (HtmlControl)this.FindControl("ifm");
Line 27: if (cover_id != null)
Line 28: ifm.Attributes["src"] = isrc;
Line 29: //Response.Redirect("Default2.aspx")
Line 30: }
\Default2.aspx.cs Line: 28
Source File: c:\Users\arsha\Documents\Visual Studio 2008\WebSites\hajcover\Default2.aspx.cs Line: 28
堆栈跟踪:
[NullReferenceException: Object reference not set to an instance of an object.]
Default2.btn1_Click(Object sender, EventArgs e) in c:\Users\arsha\Documents\Visual Studio 2008\WebSites\hajcover\Default2.aspx.cs:28
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
Version Information: Microsoft .NET Framework Version:2.0.50727.4984; ASP.NET Version:2.0.50727.4971