The Controls collection cannot be modified because the control contains code blocks

Hello There,

Today, I will talk about an exception, that might occur, if you have used Ajax custom controls along with their JavaScript in ASP.Net application.

Error.png

All you need to do is to add your JavaScript in a div tag and add runat=”server”

DIV.png

Hope it helps!

Cheers,

Rohant K.

Leave a comment