Monday, March 26, 2012

confirmbuttonextender error

I have a page with a user control in it. The user control has a 'delete' button which has a confirmbuttonextender attached to it.

I keep getting this error on the page:

[HttpException (0x80004005): The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).]
System.Web.UI.ControlCollection.Add(Control child) +233
Microsoft.AtlasControlExtender.ScriptControlWrapper.Page_PreRenderComplete(Object sender, EventArgs e) +110
System.EventHandler.Invoke(Object sender, EventArgs e) +0
System.Web.UI.Page.OnPreRenderComplete(EventArgs e) +75
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6198

My user control has code blocks to allow dynamically setting of css classes which is required.

Regards,

Andy.

Hi Andy,

Could you provide more information on the problem? The best would be a complete code sample demonstrating the problem you're having. I'm not able to figure out what's going on with just the above.

Thanks,
Ted

Hi Ted,

I have put the required code on our web server at:

http://www.apex-networks.com/files/UserControls.zip

They are all ascx files, and are used in the following heirarchy:

UserMaint.ascx contains one SiteApplicationGridViewCollection.ascx which dynamically creates as many SiteApplicationGridView.ascx as required.

At the moment there is no ConfirmButtonExtender on the delete button in UserMaint.ascx but if you add one you get the error.

Hope this helps.

Andy.

No comments:

Post a Comment