Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Apr 02, 2012 01:06 PM by mm10
Member
160 Points
307 Posts
Apr 02, 2012 12:57 PM|LINK
<asp:Image id="Img1" runat="server" ImageUrl="img.gif" /> this is asp.net.. how to write this in c# ? response.write("/Admin/Images/ok.png");//It shows error not changing there ?
Contributor
5266 Points
771 Posts
Apr 02, 2012 01:04 PM|LINK
Hi Friend, do like following, add this in your page_load event -
Image i = new Image(); i.ImageURL = "/Admin/Images/ok.png"; this.Controls.Add(i);
6445 Points
1187 Posts
Apr 02, 2012 01:06 PM|LINK
//C# code Image image = new Image(); image.Id="Img1"; image.ImageUrl = "image.gif"; PlaceHolder1.Controls.Add(image);
//Markup code (a placeholder to hold the image created in code)<asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>
maddyrafi
Member
160 Points
307 Posts
image
Apr 02, 2012 12:57 PM|LINK
<asp:Image id="Img1" runat="server" ImageUrl="img.gif" />
this is asp.net..
how to write this in c# ?
response.write("/Admin/Images/ok.png");//It shows error not changing there ?
prasadP
Contributor
5266 Points
771 Posts
Re: image
Apr 02, 2012 01:04 PM|LINK
Hi Friend,
do like following, add this in your page_load event -
Blog
mm10
Contributor
6445 Points
1187 Posts
Re: image
Apr 02, 2012 01:06 PM|LINK
//C# code Image image = new Image(); image.Id="Img1"; image.ImageUrl = "image.gif"; PlaceHolder1.Controls.Add(image);