I am facing an issue with a table that I have set up. Here is the code:
<table>
<tr>
<td id='tdleftcontent' style='border:1px solid red;'>
<asp:Label ID='lbl' runat="server"></asp:Label>
</td>
</tr>
</table>
Using control lbl in the code behind, I am trying to set the text as 'img src='/CMS/Images/News/event1.JPG' border='0'.'
protected void Page_Load(object sender, EventArgs e)
{
this.lbl.Text = "<img alt='' src='/CMS/Images/News/event1.JPG' border='0' />";
}
In Javascript, I have a function to get the height of the td element:
<script type="text/javascript">
$(document).ready(function(){
var h = document.getElementById('tdleftcontent').offsetHeight;
alert(h);
});
However, the result I am getting is h=22px, indicating that the image is not displaying on the web yet. Result picture:
If anyone could assist me in resolving this issue, I would greatly appreciate it. Thank you.