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

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

    l = new Label();
    l.Top = 35;
    l.Left = 5;

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

    l.Text = "testing";




    I've compiled the cs with the command csc /t:library MDIPicBox.dll
    as shown in

    And finally here is the html code:

    Here comes the object...
    <OBJECT ID="MyObject1" style="width: 550px; height:
    400px; border:
    <PARAM NAME="ImageName"
    value="C:\Projetos\MDIPictureBox\Doc000026_Front2_CHQ.jpeg" >

    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

    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
    Cinquini, Aug 12, 2009
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.