I would like to add <asp:image> from my codebehind onto the page. The user on my website will upload X number of pictures, and i don’t want to add the <asp:images> before the picture is uploaded.
The reason i want to add the <asp:image> is to show the user the picture which has been uploaded.
How can this be done?
I’ve seen the placeholder controller being used, but how can that be used when the variables gotta be different? For each upload the image should be added onto the site.
You can do that by creating a new Image object variable and then assigning its preperties properly then attaching the image to an existing object on your page.
Or similarly:
However, this object will not live beyond the life of the code you execute. Meaning, you won’t be able to interact with this object later on, since it is defined after the scope of Page_Init. If you want to add this image dynamically then be able to interact with it, you should add it during the Page_Init event.