The Controls collection cannot be modified because the control contains code blocks (i.e. <%...%>). Problem and why OutSystems still "lives" in the past

by brunofig 7. November 2008 20:51

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 ?

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Comments

Add comment


(Will show your Gravatar icon)

  Country flag

biuquote
  • Comment
  • Preview
Loading



Powered by BlogEngine.NET 1.4.5.7
Theme by Mads Kristensen

About the author

Hi!

My name is Bruno and I'am a senior consultant. When I'm not working, you can catch me playing with my daugther, taking photos and hanging out with my wife and friends. :)

You can also check my dark side or have fun with my vision of the world.

View Bruno Figueiredo's profile on LinkedIn

TwitterCounter for @brunoshine
 
Creative Commons License

 
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.
 

Ads

    Page List

      Most comments

      busby seo test busby seo test
      6 comments
      us United States
      Busby SEO Test Busby SEO Test
      5 comments
      Busby SEO Test Busby SEO Test
      5 comments

      Popuri.us

      My Popularity (by popuri.us)