locked
explain Error RRS feed

  • Question

  • User-1458744719 posted

    hosted website on new server.......n getting error.............plz suggest

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

    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.

    how to solve the error  page was working completely fine as i chnaged the server its creating issue now

    plz suggest

    Thursday, August 15, 2013 8:51 AM

All replies

  • User-760709272 posted

    You are trying to programatically add controls to a container that has code in <% %> blocks in the mark-up.  Best thing is to remove the script blocks and replicate the functionality in code-behind.

    Thursday, August 15, 2013 8:57 AM
  • User-1458744719 posted

    how can i solve the issue????

    plz check link to see error : http://www.harlequin.agora-me.com/ValidateEmail.aspx?email=rigidpankaj%40gmail.com&vc=1709064091 

    Plz suggest

    Friday, August 16, 2013 5:33 AM
  • User-760709272 posted

    Remove the <% %> block from the control that is giving you the error.  You'll need to find a different way of doing what the code in the <% %> block was doing.

    Friday, August 16, 2013 5:41 AM
  • User-1458744719 posted

    the <% %> block  code is already removed.....................but still its giving same error

    Friday, August 16, 2013 6:07 AM
  • User-760709272 posted

    Are you sure it is the right thing you've removed the code block from?  It wouldn't be giving the error unless there were code blocks.

    Friday, August 16, 2013 6:15 AM