Iframe Src is not a member of HtmlGenericControl

Error detail

Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: BC30456: ‘Src’ is not a member of ‘System.Web.UI.HtmlControls.HtmlGenericControl’.

This issue happen when your environment is .net 4.5 and you try to publish in environment does not have 4.5 version. Here is the 2 solution you can do.

1. Change targetFramework in web.config

Open your web.config file and find the attribute of compilation. Add the properties targetFramework=4.5.  See my example below.

<compilation debug=”true” batch=”false” optimizeCompilations=”true” targetFramework=”4.5″>


2. Change your code in behind code

This code issue is is like below

Me.yourIframeName.Src = “” &queryString

Replace the Src with Attributes.Add(“Src”,…..). Example below

Me.yourIframeName.Attributes.Add(“Src”, “” & qString)

That all.

Code On Time Homepage Error and Missing Pages in App Generator

During development by using CodeOnTime, i see this weird issue. I suddenly receive error on my homepage, and when i check my app generator it show nothing in my pages & controller list.. (refer image i attach below).

Error on homepage

Error on App generator

When i post a ticket, the help-desk suggest me to restart (of course already try before ask them, and not work at all). The other way suggest is copy from backup  file (unacceptable suggestion for me). Then i am start looking on the code from visual studio. I find out that Home.aspx (can be found inside folder Pages >> Home.aspx) got missing contentPlaceHolder.  The highlighted code in below image is miss from my page. I copy from another project the line of code, and re-run the app generator. So far it work as well as before.