On Mar 11, 12:55 pm, Jorge Barnaby <[email protected]> wrote:
>     public override void Render()
>     {
>         Context.ContextVars["pagetitle"] = pagetitle;
>
>         StringWriter sw = new StringWriter();
>         string section = "pagecontent";
>         if (HasSection(section))
>         {
>             RenderSection(section, sw);
>             Context.ContextVars[section] = sw.ToString();
>         }
>         (...)
>
>         base.Render();
>     }

   BTW, ViewComponetEx has a method, GetSectionText() which would
allow you to reduce that to:

        Context.ContextVars["pagetitle"] = pagetitle;
        string section = "pagecontent";
        if (HasSection(section))
        {
            Context.ContextVars[section] = GetSectionText(section)
        }

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to