Placing images programatically on page ASP.net Web application c# -
How can I take an image control programatically? In the asp.net web application on that page, I want to create 3 images with the program and some distance between them;
int punctX = 50; Int punctY = 50; For (int y = 0; y & lt; 2; y ++) {System.Web.UI.WebControls.Image image = new system. Web.UI.WebControls.Image (); Image.ID = "coloere" + y.ToString (); - How to insert an image on the page? }
This is better if you can use any type of place holder to add your images Are there. In this example I am using an ASP.NET panel control. In the code behind it, you can set the property property with the same property.
& lt;% @ page title = "home page" language = "c #" masterpagefile = "~ / Site.master" AutoEventWireup = "true" CodeBehind = "Default.aspx.cs "Inheritance =" stack overflow_2. default "%> & Lt; ASP: Content ID = "Header Content" Run = "Server" Content Placeholder ID = "Head Content" & gt; & Lt; / ASP: Content & gt; & Lt; Asp: Content ID = "BodyContent" runat = "server" ContentPlaceHolderID = "MainContent" & gt; & Lt; Asp: panel id = "pnlImages" runat = "server" & gt; & Lt; / Asp: Panel & gt; & Lt; / ASP: Content & gt; provided that you have such images
Stack.imgur .com / DmRr4.png "alt =" Enter image details here ">
Comments
Post a Comment