Help: Can't display a image on a picturebox in an UserControl throughIE

Discussion in 'ASP .Net Web Controls' started by Cinquini, Aug 12, 2009.

  1. Cinquini

    Cinquini Guest

    Hi. I'm trying t display a LOCAL image (i.e. on a hard disk) in a web
    browser using a embedded user control.

    here's the code:

    namespace MDIPictureBox
    {
    public partial class MDIPicBox : UserControl
    {
    private string imageName = "";
    private PictureBox p;
    Label l;

    public MDIPicBox()
    {
    //InitializeComponent();

    p = new PictureBox();
    p.Top = 50;
    p.Left = 5;
    p.Height = 400;
    p.Width = 500;
    this.Controls.Add(p);

    l = new Label();
    l.Top = 35;
    l.Left = 5;
    this.Controls.Add(l);
    }

    public string ImageName
    {
    set {
    this.imageName = value;
    p.ImageLocation = this.imageName;
    p.Refresh();

    l.Text = "testing";
    l.Refresh();

    }
    }

    }

    }

    I've compiled the cs with the command csc /t:library MDIPicBox.dll
    as shown in http://www.devhood.com/tutorials/tutorial_details.aspx?tutorial_id=187

    And finally here is the html code:

    <html>
    <head>
    </head>
    <body>
    Here comes the object...
    <OBJECT ID="MyObject1" style="width: 550px; height:
    400px; border:
    1px;"
    CLASSID="HTTP://127.0.0.1/
    MDIPicBox.dll#MDIPictureBox.MDIPicBox"
    VIEWASTEXT>
    <PARAM NAME="ImageName"
    value="C:\Projetos\MDIPictureBox\Doc000026_Front2_CHQ.jpeg" >
    </OBJECT>
    </body>
    </html>

    All I've got is a white box with a disabled vertical scrool bar. Even
    qhen aI comment out the picturebox generation code, the label isn't
    shown.

    Could anyone give me some help? I pretty sure that here's a problem
    with security, but what I have to change? In with place? Or there's a
    problem in code?

    Thanks in advance and excuse me my poor English. It's not my first
    language.
    Cinquini, Aug 12, 2009
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Charles A. Lackman

    Rotating a Picturebox

    Charles A. Lackman, Oct 13, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    933
    Supra
    Oct 14, 2004
  2. ma

    problem with picturebox

    ma, Mar 12, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    643
    Bruno van Dooren
    Mar 12, 2006
  3. huobazi
    Replies:
    1
    Views:
    668
    David Waz...
    Jul 3, 2003
  4. Bitmaps in picturebox

    , Oct 24, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    439
    Kevin Spencer
    Oct 24, 2003
  5. Rishi Boparai
    Replies:
    1
    Views:
    1,180
    Peter Bucher [MVP]
    May 5, 2008
Loading...

Share This Page