從Framework 2.0-3.5 更新到Framework 4.5時遇到 Iframe 轉換為伺服器控件遇到不相容問題
錯誤資訊:
but its type (System.Web.UI.HtmlControls.HtmlIframe) is not compatible with the type of control (System.Web.UI.HtmlControls.HtmlGenericControl).
原因分析:
在.NET Framework 4.5 中, iframe的HTML 标記不再向HtmlGenericControl類的映射,需映射到System.Web.UI.HtmlControls.HtmlIframe
參考文檔:
https://briancaos.wordpress.com/2013/08/07/system-web-ui-htmlcontrols-htmliframe-is-not-compatible-with-the-type-of-control-system-web-ui-htmlcontrols-htmlgenericcontrol/
https://support.microsoft.com/zh-cn/help/941824/error-message-when-you-build-an-asp.net-2.0-web-application-in-visual