Results 1 to 3 of 3

Thread: [2008] Adding web control in html table cell

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2006
    Posts
    274

    [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>)

  2. #2
    Learning .Net danasegarane's Avatar
    Join Date
    Aug 2004
    Location
    VBForums
    Posts
    5,853

    Re: [2008] Adding web control in html table cell

    You could try

    Code:
    Dim td as HtmlTableCell=New HtmlTableCell()
    td.Controls.Add(m_img )

  3. #3
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,173

    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
  •  



Click Here to Expand Forum to Full Width