ListBox, ActiveXObject

G

Guest

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
 
V

Viktor Jevdokimov

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 said:
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).
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top