Creative Minds

Because we all have one

OutSystems: The controls collection cannot be modified because the control contains code blocks (i.e. <%...%>).

Lately I’ve been working with the OutSystems platform . For all of you that need to develop small to medium applications on a record time, this is the tool.

Although developed in .Net, the OS platform just recently updated their tools to the 2.0 version of the .NET framework.

"So, what does this introduction has to do with the title?"

What happens is that I developed a HttpModule to add some meta tags to all applications under IIS.

All worked well until we started using one of the OS management applications. The error was: "The Controls collection cannot be modified because the control contains code blocks (i.e. <%…%><% … %>). "

"What the heck?!"

After browsing thru the OS management application page files, I found this piece of code on almost all pages of the application:

<head runat="server"
>

<title><%= HttpUtility.HtmlEncode (Title) %></title>
<meta http-equiv="Content-Type"
 content="text/html; charset=utf-8"
 />
<link href="web.css" 
type="text/css"
 rel="stylesheet" 
/><%= GetJavaScriptIncludes() %>
<script src="<%= OutSystems.HubEdition.RuntimePlatform.Web.JavaScriptManager.GetRelativeJavaScriptPrefix() %>_osvalidators.js"

 type="text/javascript" 
charset="UTF-8"
></script>
</head>

Has you can see, although the head tag as the attribute runat="server" they still use markup text (<%…%>). Has Rick explains , when using the markup text, the generated code for the page changes, and all markup text is translated to Response.write and the controls collection of the container is hardcoded living no room for adding new controls.

So for me, the big question is: Since the OS team updated their solution to the .NET 2.0 version, why didn’t they also upgraded the management application to use all the cool (and helpful) features? Why not use MasterPages? Why not use the ClientScript.RegisterClientScriptBlock and this.ClientScript.RegisterClientScriptInclude ? Why not use the Page.Title ?

 Digg  Facebook  StumbleUpon  Technorati  Deli.cio.us 

Tagged as , , + Categorized as Outsystems

Leave a Reply