Selecting a file on an Editpage

Discussion in 'ASP .Net' started by Nenefta, Apr 19, 2006.

  1. Nenefta

    Nenefta Guest

    Hi all,

    How would I go about creating an editpage where the user can select a
    file (e.g. using the UploadFile Control)? The selected filename will be
    stored in a DB. However, I need the page to show this filename in that
    same control when the user comes around this page a second time to edit
    the data again... The big problem is that I don't know any control that
    will allow me to initialise with a filename and is able to throw the
    FileSelect Dialogbox. Is there anything like that out there??

    Greets,
    Marcel
     
    Nenefta, Apr 19, 2006
    #1
    1. Advertising

  2. Nenefta

    Nenefta Guest

    For the record:

    I found a simple workaround for my problem. I created a div that is
    shown on top of my <input file> control. Javascript will fill in the
    selected documentname. I can now initialise the textbox with the
    filename previously selected:

    <div style="position:relative">
    <div id="ImageFileSelect"
    style="position:absolute;background-color:white;left:0;top:0;">
    <asp:TextBox ID="tbImage" runat="server" Height="14px"
    Width="272px"></asp:TextBox>
    </div>
    <input id="File1" style="width: 376px" type="file"
    onchange="this.form.ctl00$cphContent$BerichtEdit1tbImage.value=this.value;return
    true;"/>
    </div>

    Tricky part is to get the controlname for the textbox right.... ;-)

    Grts,
    Marcel
     
    Nenefta, Apr 20, 2006
    #2
    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. Dave56

    Selecting a file client side

    Dave56, Aug 2, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    365
    Kevin Spencer
    Aug 2, 2004
  2. http://www.visual-basic-data-mining.net/forum

    Displaying image after selecting an image file.

    http://www.visual-basic-data-mining.net/forum, Sep 15, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    369
    http://www.visual-basic-data-mining.net/forum
    Sep 15, 2004
  3. ~~~ .NET Ed ~~~
    Replies:
    0
    Views:
    325
    ~~~ .NET Ed ~~~
    Mar 7, 2005
  4. Kilicaslan Fatih
    Replies:
    1
    Views:
    265
    Diez B. Roggisch
    Jul 6, 2006
  5. Kilicaslan Fatih
    Replies:
    1
    Views:
    284
    Eric Brunel
    Jul 6, 2006
Loading...

Share This Page