469,275 Members | 1,475 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,275 developers. It's quick & easy.

Compile errors after converting to a Web Application Project from

I'm trying to convert a Web Site to the Web Application project model and I'm
running into compile errors that do not seem to be covered by the guidance I
found at "Converting a Web Site Project to a Web Application Project".

The issue is that standard ASP.NET controls that are embedded as child
controls within the ContentTemplate of the Ajax Control Toolkit's
TabContainer/TabPanel are no longer visible to the page (and result in
compile errors). It appears that they can only be referenced with a call to
FindControl whereas, when the project was a Web Site, they were directly
accessible in the page's code behind file as properties.

Unfortunately, we have a lot of webforms that utilize the TabContainer, and
converting all the references to child controls from simple property refences
to FindControl calls will be quite burdensome.

While researching the problem I found a reference to a property called
TemplateInstance that seemed promising, but I understand that this is
applicable to control designers, not control users.

I thought I'd add one other point. The problem is not specific to the Ajax
Control Toolkit's TabContainer. Indeed, I have a FormView control, and all
the child controls in the ItemTemplate are no longer recognized by the
compiler as being properies of the Page and result in compile errors. I can't
believe that I have to change all of these propery references to findcontrol
calls throughout my forms just because I moved from a Web Site to a Web
Application Project. :-(
Nov 21 '08 #1
1 2388
web applications are a bit of a hack. the codebehind are compiled by visual
studio, the aspx by the aspnet_compiler. because the partial classes are in
seperate dll's, there are more restrictions on code sharing (web site compile
the aspx and the code behind into one dll, so all parial class features are
available). to get around some of the restrictions, the ide generates those
designer files, which allows type information to be shared between the
partial classes (basically declaring server controls as protected global).

so yes, you have to do the convert. there is a performance cost to using
findcontrol, so you want to avoid this as much as possible.

i have never seen an advantage to switch to web applications, but have
converted web applications to web sites. (the main exception is MVC
applications, but then you don't have codebehind files).

-- bruce (sqlwork.com)
"Howard Pinsley" wrote:
I'm trying to convert a Web Site to the Web Application project model and I'm
running into compile errors that do not seem to be covered by the guidance I
found at "Converting a Web Site Project to a Web Application Project".

The issue is that standard ASP.NET controls that are embedded as child
controls within the ContentTemplate of the Ajax Control Toolkit's
TabContainer/TabPanel are no longer visible to the page (and result in
compile errors). It appears that they can only be referenced with a call to
FindControl whereas, when the project was a Web Site, they were directly
accessible in the page's code behind file as properties.

Unfortunately, we have a lot of webforms that utilize the TabContainer, and
converting all the references to child controls from simple property refences
to FindControl calls will be quite burdensome.

While researching the problem I found a reference to a property called
TemplateInstance that seemed promising, but I understand that this is
applicable to control designers, not control users.

I thought I'd add one other point. The problem is not specific to the Ajax
Control Toolkit's TabContainer. Indeed, I have a FormView control, and all
the child controls in the ItemTemplate are no longer recognized by the
compiler as being properies of the Page and result in compile errors. I can't
believe that I have to change all of these propery references to findcontrol
calls throughout my forms just because I moved from a Web Site to a Web
Application Project. :-(
Nov 22 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Lowell | last post: by
reply views Thread by BruinBySea | last post: by
1 post views Thread by Ravi Chaudhary | last post: by
6 posts views Thread by Kevin Atherton | last post: by
27 posts views Thread by Rene | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.