"The Controls collection cannot be modified because the control contains code blocks"
Bonjour,
J'ai cette erreur en ASP.NET
Citation:
The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[HttpException (0x80004005): The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).]
System.Web.UI.ControlCollection.Add(Control child) +2108047
SharePointCodeBehindPages.CodeBehindPosition.btManagePosition_Click(Object sender, EventArgs e) +1915
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +177
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1746
J'ai réussi à la localiser dans mon code, mais je n'arrive pas à résoudre le problème...
J'ai pas mal googler, mais sans succès. Je bosse sous SharePoint, donc pas de possibilité de mettre un tag body avec runat = server.
Ce code est dans un usercontrol également. Je pense que c'est bon de le préciser ^^
Si vous avez une idée, ce serai chouette ^^
Merci bien