Click here to Skip to main content
15,918,742 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I have created a div tag with id and runat server, when the code is inserted from the server side(c#) using inner html of div, the code is inserted, but the image specified is not shown. what could be the problem?


ex.

HTML Code:
----------

;

;

C# code
-------

protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
GenerateHTMLCode();

}
}

public void GenerateHTMLCode()
{
content_container.InnerHtml = "";


}
Posted
Updated 7-Dec-09 16:40pm
v2

1 solution

asp:Image is a server side tag. InnerHtml is for HTML, not for ASP.NET. ASP.NET renders into HTML. If you want to insert an image, you'll have to do it using an HTML tag ("img" is the HTML tag for image).
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900