c# – how to change properties of an object that wasn't created dynamically asp.net-ThrowExceptions

Exception or error:

Hello I’m trying to change properties of an object I created in the aspx page with my code.
I want something that will work something like this

the aspx page:

 <asp:ImageButton ID="A01" runat="server" />

the sample code:

 ImageButton btn2=new ImageButton();
 btn2.ID = "A01";
 btn2.ImageUrl = @"\photo\4InARow\RED.png";

is it even possible?

How to solve:

Leave a Reply

Your email address will not be published. Required fields are marked *