ListBox, ActiveXObject

Discussion in 'ASP .Net' started by =?Utf-8?B?T3Jlbg==?=, Apr 8, 2004.

  1. Hi

    I have 2 simple questions and hope someone can help me

    1) I have an aspx page with the Control: HTML ListBox on it (runat=server). I'm adding options in JavaScript
    ....
    mySelect = document.addFiles.lis
    var myI = mySelect.selectedIndex +
    mySelect.options[myI] = new Option(sFile,"2"
    ...

    After that I'm doing POST and in the event 'Page_Load' catch this by
    if (Request.HttpMethod=="POST"

    // How can I find ALL the options that I have added in JavaScript ??
    // the: Value && Tex


    2) How can I , in JavaScript, get the file size with
    // var fso = new ActiveXObject("Scripting.FileSystemObject")
    // I get an error - "Automation server can't creat Object" ? why ??? Any Ideas
    I'm using File HTML control - I don't need to Upload files but get there size + full name (with full path)

    thanx
    =?Utf-8?B?T3Jlbg==?=, Apr 8, 2004
    #1
    1. Advertising

  2. 1. All of these options should be selected to be sent with the post/get. Or
    use hidden input to collect such "options".
    2. You can't access ActiveX objects in such way. You may use <OBJECT> tag
    for your ActiveX programs, which works in IE only, but security settings may
    not to permit to run such objects.

    "Oren" <> wrote in message
    news:...
    > Hi,
    >
    > I have 2 simple questions and hope someone can help me:
    >
    > 1) I have an aspx page with the Control: HTML ListBox on it

    (runat=server). I'm adding options in JavaScript:
    > ...
    > mySelect = document.addFiles.list
    > var myI = mySelect.selectedIndex + 1
    > mySelect.options[myI] = new Option(sFile,"2")
    > ...
    >
    > After that I'm doing POST and in the event 'Page_Load' catch this by:
    > if (Request.HttpMethod=="POST")
    > {
    > // How can I find ALL the options that I have added in JavaScript ???
    > // the: Value && Text
    > }
    >
    > 2) How can I , in JavaScript, get the file size with:
    > // var fso = new ActiveXObject("Scripting.FileSystemObject");
    > // I get an error - "Automation server can't creat Object" ? why ??? Any

    Ideas ?
    > I'm using File HTML control - I don't need to Upload files but get there

    size + full name (with full path).
    >
    > thanx
    Viktor Jevdokimov, Apr 8, 2004
    #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. Oren

    ActiveXObject

    Oren, Nov 23, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    912
    Chris Jackson
    Nov 24, 2003
  2. Nomad
    Replies:
    1
    Views:
    656
    Dominic Myers
    Sep 10, 2004
  3. Nomad
    Replies:
    0
    Views:
    950
    Nomad
    Sep 14, 2004
  4. reclusive monkey

    XMLDOM & ActiveXObject

    reclusive monkey, Jan 19, 2005, in forum: XML
    Replies:
    3
    Views:
    1,466
    reclusive monkey
    Jan 19, 2005
  5. =?Utf-8?B?QWxoYW1icmEgRWlkb3MgS2lxdWVuZXQ=?=

    ActiveXObject("Shell.Application")

    =?Utf-8?B?QWxoYW1icmEgRWlkb3MgS2lxdWVuZXQ=?=, May 16, 2007, in forum: ASP .Net
    Replies:
    4
    Views:
    5,147
    Alvin Bruney [MVP]
    May 17, 2007
Loading...

Share This Page