How to settext to Asp.Net FileUpload?

Rate It (1)

Last post 10-05-2009 9:09 PM by david4chao. 2 replies.

Sort Posts:

  • How to settext to Asp.Net FileUpload?

    10-05-2009, 1:23 PM
    • Member
      5 point Member
    • david4chao
    • Member since 08-19-2009, 8:47 AM
    • Posts 6

    How to settext to Asp.Net FileUpload?

    e.g. on asp.net web page, I have:

    <asp:FileUpload ID="FileUpload_String_largeIcon" runat="server" />

                HtmlInputElement _ControlOflargeIcon = (HtmlInputElement)_ContainerOfControlOflargeIcon.ChildElements.Find("FileUpload_String_largeIcon");
                CommandParameters _A = new CommandParameters(WaitFor.None, PopupAction.ConfirmOK);
                _ControlOflargeIcon.Click(_A);
                _ControlOflargeIcon.SetText("D:\\Test\\1.jpg");

    I want to set the file path:

    HtmlInputElement _ControlOflargeIcon = (HtmlInputElement)_ContainerOfControlOflargeIcon.ChildElements.Find("FileUpload_String_largeIcon");

    _ControlOflargeIcon.SetText("D:\\Test\\1.jpg");

    It is not working.

    Filed under:
  • Re: How to settext to Asp.Net FileUpload?

    10-05-2009, 3:34 PM
    Answer
    • Participant
      1,775 point Participant
    • hugonne
    • Member since 03-18-2009, 9:18 PM
    • Medellin, Colombia
    • Posts 308

    You can't do it directly, although there are "alternate" ways. Check this thread:

    http://forums.asp.net/t/1121953.aspx  

    :. HUGONNE .:

    Please mark as answer if the post helps.

    Visit my coding blog. It's just starting, so any comments are well appreciated.
  • Re: How to settext to Asp.Net FileUpload?

    10-05-2009, 9:09 PM
    • Member
      5 point Member
    • david4chao
    • Member since 08-19-2009, 8:47 AM
    • Posts 6

    hugonne:

    You can't do it directly, although there are "alternate" ways. Check this thread:

    http://forums.asp.net/t/1121953.aspx  

    I got your answer, thank you very much.



Page 1 of 1 (3 items)