Wednesday, October 9, 2013
Asp.net - The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>)
Asp.net - The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>)
I have this issue when I want to change button text in Page_init method.
This occured because I am using resource file to bind Button text.
Example:
<button class="simpleFormButton" id="btnSaveFinishButton" runat="server" type="button">
<%=GetLocalResourceObject("SaveandFinish")%></button>
Replacing '<%=' to '<%#' solved my issue.
Hope this helps you as well.
I have this issue when I want to change button text in Page_init method.
This occured because I am using resource file to bind Button text.
Example:
<button class="simpleFormButton" id="btnSaveFinishButton" runat="server" type="button">
<%=GetLocalResourceObject("SaveandFinish")%></button>
Replacing '<%=' to '<%#' solved my issue.
Hope this helps you as well.
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment