views:

24

answers:

2

Hi guys,

I'm with a problem

The scenario is the follow:

After submitting a form the user recieves one message says OK, and is redirected to another page after 2seconds.

The problem is, when insert is sucefully, i add to the header of the masterpage a HtmlMeta element, but when i'm inserting from the contentplaceholder, i recieved a followed error:

" The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>). "

any solution guys?

apreciated

A: 

sure, the piece of code is here..

public static void MetaRedirect(Page p, string url) { HtmlMeta meta = new HtmlMeta();

        meta.Content = "2;url=" + url;
        meta.HttpEquiv = "refresh";

        p.Header.Controls.Add(meta);
    }
ROCK HEART
You should just edit your question to include further requested details. Otherwise things will get very confusing when other answers come in, etc.
Chris
A: 

Two things spring to mind. The first is potentially overkill but could be useful for other things as well: add a new content area in the master page in the header that you can then use to add any header elements you want. Alternatively you can probably just add a placeholder into your header for much the same effect.

Chris