Hi

I am using the following method to display error messages in my
asp.net c# system:

currentPage.Controls.Add(new LiteralControl("<script
language='javascript'> window.alert('" + strMsg + "')</script>"));

However, at certain times this falls over with the message:

The control collection cannot be modified during DataBind, Init, Load,
PreRender or Unload phases

Is there a way round this, like maybe using a deferred message?

Stapes

Reply via email to