-
May 29th, 2008, 12:16 AM
#1
Thread Starter
Hyperactive Member
[2008] Adding web control in html table cell
Is it not possible to add image in html table col in such a way?
the image doesnt come out, instead System.Web.UI.WebControls.ImageButton appears in the column.
Code:
Dim m_img As ImageButton : m_img = New ImageButton : m_img.PostBackUrl = "admin_license?serialno= " & m_serialno & ""
m_img.ImageUrl = "edit.gif"
Response.Write(<td><%= m_img %></td>)
-
May 29th, 2008, 08:12 AM
#2
Re: [2008] Adding web control in html table cell
You could try
Code:
Dim td as HtmlTableCell=New HtmlTableCell()
td.Controls.Add(m_img )
-
May 29th, 2008, 02:49 PM
#3
Re: [2008] Adding web control in html table cell
Response.Write(<td><%= m_img %></td>)
You cannot do this. You cannot put inline code in a 'string' and use it in Response.Write. You need to understand the difference between 'codebehind' and the rendered source. When you have
<% =something %>
on a page, it is interpreted at runtime and processed. When you use Response.Write, it's outputting HTML directly to the browser, it cannot be interpreted by a compiler at all.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|