Results 1 to 3 of 3

Thread: [RESOLVED] HtmlGenericControl help please.

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Dec 2004
    Posts
    65

    Resolved [RESOLVED] HtmlGenericControl help please.

    Hi all,
    This should be so easy but for some reason I just cant get my head around it. I'm using asp.net 2005 to create a page that displays images.
    The images display perfectly, but when I try to display only a portion or part of the images (like a preview mode) I start getting problems.
    The source code I'm using is as follows:

    Source Code:
    Dim mydiv As New System.Web.UI.HtmlControls.HtmlGenericControl

    mydiv = New System.Web.UI.HtmlControls.HtmlGenericControl("div id=" & Chr(34) & MyImageCell.ID & "Holder" & Chr(34) & " style=" & Chr(34) & "position: absolute; top:112; left:480; clip : rect(0px, 450px, " & CLng(TXTImagePreviewSize.Text) & "px, 0px)" & Chr(34) & ">" & vbNewLine & "<img src=" & Chr(34) & MyImagePath & MyImage & Chr(34) & ">" & vbNewLine & "</div")

    Panel2.Controls.Add(mydiv)

    What am I doing wrong? Any ideas?

    Thankx in advance

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

    Re: HtmlGenericControl help please.

    The constructor for the HtmlGenericControl does not take HTML, it takes the name of the tag.

    Code:
    Dim mydiv As New System.Web.UI.HtmlControls.HtmlGenericControl("div")

    That's it. You then set properties if you need it, such as mydiv.Attributes.Add() and mydiv.InnerText/.InnerHtml

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Dec 2004
    Posts
    65

    Re: HtmlGenericControl help please.

    Thank you
    I thought it would be easy enough...

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