Welcome Guest Search | Active Topics | Log In | Register

The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... Options
icm76
#1 Posted : Thursday, June 18, 2009 10:26:30 PM
Rank: Member


Joined: 4/16/2009
Posts: 25
Points: 75
Location: RO

I tried to use latest GPL version from the night build with DotNetNuke but, apparently, this error seem to appear again:

http://tracker.gaiaware.net/issue/ViewIssue.aspx?id=36

Thank you,
Catalin

sergey
#2 Posted : Friday, June 19, 2009 12:41:39 PM
Rank: Titan


Joined: 9/23/2008
Posts: 269
Points: 807
Hi.
Does this happen only in DNN?
Have you tried a simple sample outside of DNN?
icm76
#3 Posted : Sunday, June 21, 2009 5:39:00 PM
Rank: Member


Joined: 4/16/2009
Posts: 25
Points: 75
Location: RO

Hi,

This happend on DNN 4.9.3, in my production server. When I reveered back to Gaia 3.5 everything worked ok.

On the development machine (DNN 4.5) with the latest gaia it did not happen.

Catalin

janblo
#4 Posted : Sunday, June 21, 2009 6:24:27 PM
Rank: Titan



Joined: 8/21/2008
Posts: 338
Points: 2,017
Gaia Ajax 3.5 and 3.6 for that matter doesn't inject any control into the controls collection to render the GPL statement. It's being rendered to the page via the ResponseFilterStream class.

Therefore my hunch is that there's some reference mismatch?

My belief is also strenghtend by the fact that it works on your development machine but not in production.

If I am mistaken we need further information about the exact Exception. Maybe some of the other controls are trying to modify the controls collection in the wrong event. Maybe you could also post some code for us to review.
Gaiaware Core Developer

Follow us at Twitter : http://twitter.com/janblomquist
icm76
#5 Posted : Sunday, June 21, 2009 10:13:16 PM
Rank: Member


Joined: 4/16/2009
Posts: 25
Points: 75
Location: RO

All my modules without gaia worked just fine after the upgrade and I realize that the gaia-based modules did not work only when I tested the app. in the production server. lucky me that I made the upgrade in the middle of the night :) when nobody accessed the app.

When the error appeared, I have made a full recompilation of my solution on the production server taking care to specify "specific version=false" for the gaia assemblies. So, DNN 4.9.3 + Gaia 3.6.night build=the error above.

After I downloaded the GPL Gaia 3.5, I copied the assemblies in the BIN folder, I have re-made the references and recompiled and everithing worked nice :)

This is the error from the log:

AssemblyVersion: 04.09.03
PortalID: 18
PortalName: Stiinte Economice
UserID: 1
UserName: host
ActiveTabID: 980
ActiveTabName: Gestiune Studenti
RawURL: /agsis/Default.aspx?tabid=980&language=ro-RO
AbsoluteURL: /agsis/Default.aspx
AbsoluteURLReferrer: http://gesco.unitbv.ro/a...=1281&language=ro-RO
UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.0.11) Gecko/2009060215 Firefox/3.0.11
DefaultDataProvider: DotNetNuke.Data.SqlDataProvider, DotNetNuke.SqlDataProvider
ExceptionGUID: ddbb2bad-1ba9-4f8f-8a95-d9b454668c09
InnerException: The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).
FileName:
FileLineNumber: 0
FileColumnNumber: 0
Method: System.Web.UI.ControlCollection.Add
StackTrace:
Message: DotNetNuke.Services.Exceptions.PageLoadException: The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>). ---> System.Web.HttpException: The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>). at System.Web.UI.ControlCollection.Add(Control child) at Gaia.WebWidgets.Manager.page_PreRenderComplete(Object sender, EventArgs e) at System.EventHandler.Invoke(Object sender, EventArgs e) at System.Web.UI.Page.OnPreRenderComplete(EventArgs e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) --- End of inner exception stack trace ---
Source:
Server Name: SERVER2

 

and another one:

AssemblyVersion: 04.09.03
PortalID: 18
PortalName: Stiinte Economice
UserID: 1
UserName: host
ActiveTabID: 1170
ActiveTabName: Grupe
RawURL: /agsis/Default.aspx?tabid=1170&language=ro-RO
AbsoluteURL: /agsis/Default.aspx
AbsoluteURLReferrer:
UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; WOW64; SV1; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; FDM)
DefaultDataProvider: DotNetNuke.Data.SqlDataProvider, DotNetNuke.SqlDataProvider
ExceptionGUID: b619846c-d235-4eff-a417-0b06e47d2a6b
InnerException: The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).
FileName:
FileLineNumber: 0
FileColumnNumber: 0
Method: System.Web.UI.ControlCollection.Add
StackTrace:
Message: DotNetNuke.Services.Exceptions.PageLoadException: The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>). ---> System.Web.HttpException: The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>). at System.Web.UI.ControlCollection.Add(Control child) at Gaia.WebWidgets.Manager.page_PreRenderComplete(Object sender, EventArgs e) at System.EventHandler.Invoke(Object sender, EventArgs e) at System.Web.UI.Page.OnPreRenderComplete(EventArgs e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) --- End of inner exception stack trace ---
Source:
Server Name: SERVER2

and another one:

AssemblyVersion: 04.09.03
PortalID: 18
PortalName: Stiinte Economice
UserID: 1
UserName: host
ActiveTabID: 1171
ActiveTabName: Promovare studenti
RawURL: /agsis/Default.aspx?tabid=1171&language=ro-RO
AbsoluteURL: /agsis/Default.aspx
AbsoluteURLReferrer: http://gesco.unitbv.ro/a...l+contains+code+blocks+(i.e.+%3c%25+...+%25%3e).&content=0
UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.0.11) Gecko/2009060215 Firefox/3.0.11
DefaultDataProvider: DotNetNuke.Data.SqlDataProvider, DotNetNuke.SqlDataProvider
ExceptionGUID: 64dfc581-996c-4791-96bd-87c919c168c3
InnerException: The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).
FileName:
FileLineNumber: 0
FileColumnNumber: 0
Method: System.Web.UI.ControlCollection.Add
StackTrace:
Message: DotNetNuke.Services.Exceptions.PageLoadException: The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>). ---> System.Web.HttpException: The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>). at System.Web.UI.ControlCollection.Add(Control child) at Gaia.WebWidgets.Manager.page_PreRenderComplete(Object sender, EventArgs e) in E:\Temp\GaiaAjax.GPL.3.6.18.6.2009\Source\Gaia.WebWidgets\Core\Manager.cs:line 407 at System.EventHandler.Invoke(Object sender, EventArgs e) at System.Web.UI.Page.OnPreRenderComplete(EventArgs e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) --- End of inner exception stack trace ---
Source:
Server Name: SERVER2

sergey
#6 Posted : Monday, June 22, 2009 7:45:11 AM
Rank: Titan


Joined: 9/23/2008
Posts: 269
Points: 807
Hi.

I can confirm that this is a compatibility issue. It's not a bug, but rather limitation of ASP.NET.
To find a solution, could you please let us know if you have added the code block elements <%= %> to your page or DNN does this?
If it's your page which adds the elements, can you post the page?

Thanks.
icm76
#7 Posted : Tuesday, June 23, 2009 7:36:35 AM
Rank: Member


Joined: 4/16/2009
Posts: 25
Points: 75
Location: RO

Hi,

I use the following elements:

  • <%=TemplateSourceDirectory %> for adding links to styles relative to each module' folder 
  • custom public static variable specifying the relative webpath to my solution
  • normal databinding

Here is the source code for one of my modules (working with gaia 3.5 but not with gaia 3.6)

TipIntrareIesire.ascx, TaxeStudent.ascx are both gaia-based user-controls. And they are used (via FDSG.ascx) in almost all my modules.

Thank you,
Catalni

sergey
#8 Posted : Tuesday, June 23, 2009 7:48:59 AM
Rank: Titan


Joined: 9/23/2008
Posts: 269
Points: 807
Could you please try putting <%=TemplateSourceDirectory %> element into a div with runat="server" attribute and see if it fixes the issue?
icm76
#9 Posted : Sunday, June 28, 2009 6:08:24 PM
Rank: Member


Joined: 4/16/2009
Posts: 25
Points: 75
Location: RO

Sorry, it does not fix the issue

I have tried with both:

<div runat=server><link id="lnkCSSAsociereTaxe" rel="stylesheet" type="text/css" href="<%= TemplateSourceDirectory%>/module.css" /></div>

and

<div runat=server><link id="lnkCSSAsociereTaxe" rel="stylesheet" type="text/css" href="<%# TemplateSourceDirectory%>/module.css" /></div>

Please note the = vs. # as I have read on ather forums.

Catalin

sergey
#10 Posted : Sunday, June 28, 2009 8:07:56 PM
Rank: Titan


Joined: 9/23/2008
Posts: 269
Points: 807
Hi.

I've verified the code block you posted and it fixed the issue. Putting code blocks into <div runat="server" /> fixed the issue.
May it be that you have some other code blocks on your page?
Have your tried putting all code blocks into html elements with runat="server" attribute as suggested?
Can you post a simple testcase which fails?
icm76
#11 Posted : Monday, June 29, 2009 6:12:26 PM
Rank: Member


Joined: 4/16/2009
Posts: 25
Points: 75
Location: RO

I have created an installable DotNetNuke module with source code (http://www.unitbv.ro/cata/errors/test_agsis_01.00.00_Install.zip) that contains the following:

- simple usercontrols, with a gaia:checkboxlist without any code blocks
- simple databinding in code behind
- references to Gaia.WebWidgets, Version=3.6.595.1 (please put the necessary assemblies in the bin folder of the dotnetnuke) and DotNetNuke, Version=4.9.3.21

I still have the same error and my usercontrol does not contain any code blocks

Catalin

sergey
#12 Posted : Monday, June 29, 2009 9:47:20 PM
Rank: Titan


Joined: 9/23/2008
Posts: 269
Points: 807
Could you please be so kind to provide the referenced Gaia assembly or configure to non-specific version if possible? :)
icm76
#13 Posted : Tuesday, June 30, 2009 7:43:39 AM
Rank: Member


Joined: 4/16/2009
Posts: 25
Points: 75
Location: RO

Here is a link to a zip file containing the assemblies (http://www.unitbv.ro/cata/errors/gaia3.6.595.1.zip)

Catalin

sergey
#14 Posted : Tuesday, June 30, 2009 10:35:16 AM
Rank: Titan


Joined: 9/23/2008
Posts: 269
Points: 807
Thanks for providing the testcases.

The problem occurs because in DNN Default.aspx they use code blocks on page-level html element like follows:
Code:
<html <%=xmlns%> <%=LanguageCode%>>


Until we come up with better solution, if you can access and remove those code blocks it will work.
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.