473,809 Members | 2,710 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Client side script?

I'm working in ASP.NET 2.0 and am having problems with some client side
script on my .aspx pages.

The script looks like this:
<script language=vbscri pt>
function OpenFile(FileTo Open)
Set oShell = CreateObject("W Script.Shell")
oShell.Run("exp lorer " & FileToOpen)
end function
</script>

The idea was to use explorer to open these files. The problem I'm having
though is on the line:
Set oShell = CreateObject("W Script.Shell")
I keep getting the message ActiveX component can't create object:
'WScript.Shell'

I'm totally confused because this exact same code runs fine if I write it in
a .htm file.
Why does my browser treat my .aspx page differently than the .htm file?

Thanks,
Jan 26 '06 #1
2 1210
I get the error that you mentioned only if I set all options under "ActiveX
controls and plug-ins" to "disable" in the Internet Options->Security->Custom
level, but if these options are set to "Enable", your script works fine.
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Chase" wrote:
I'm working in ASP.NET 2.0 and am having problems with some client side
script on my .aspx pages.

The script looks like this:
<script language=vbscri pt>
function OpenFile(FileTo Open)
Set oShell = CreateObject("W Script.Shell")
oShell.Run("exp lorer " & FileToOpen)
end function
</script>

The idea was to use explorer to open these files. The problem I'm having
though is on the line:
Set oShell = CreateObject("W Script.Shell")
I keep getting the message ActiveX component can't create object:
'WScript.Shell'

I'm totally confused because this exact same code runs fine if I write it in
a .htm file.
Why does my browser treat my .aspx page differently than the .htm file?

Thanks,

Jan 26 '06 #2
Thanks Phillip,

I tested this like you state, and I believe you are correct. I see that
adding my site to trusted sites has the desired effect, and may be the
approach I will have to take.

Thanks again,

- Chase

"Phillip Williams" wrote:
I get the error that you mentioned only if I set all options under "ActiveX
controls and plug-ins" to "disable" in the Internet Options->Security->Custom
level, but if these options are set to "Enable", your script works fine.
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Chase" wrote:
I'm working in ASP.NET 2.0 and am having problems with some client side
script on my .aspx pages.

The script looks like this:
<script language=vbscri pt>
function OpenFile(FileTo Open)
Set oShell = CreateObject("W Script.Shell")
oShell.Run("exp lorer " & FileToOpen)
end function
</script>

The idea was to use explorer to open these files. The problem I'm having
though is on the line:
Set oShell = CreateObject("W Script.Shell")
I keep getting the message ActiveX component can't create object:
'WScript.Shell'

I'm totally confused because this exact same code runs fine if I write it in
a .htm file.
Why does my browser treat my .aspx page differently than the .htm file?

Thanks,

Jan 27 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
4344
by: Kathryn | last post by:
Hiya I have a problem with using some client side and server side scripting together in an ASP. I'm using VBScript. What I'm trying to achieve is this - - Page loads up and some server side vbscript reads the database and populates a listbox on the page with the first field from each record in the recordset. This works fine. - User selects an option on the listbox and, using the OnChange, I
5
1977
by: tmb | last post by:
Is there a way to use ASP to 'push' a new image to the client every 15 seconds or so? I guess the entire page will have to be 're-sent' to the client but I'm not sure. I'm trying to 'rotate' a new product image every few seconds. I could use an animated gif or some java script maybe, but I want to keep the file small and not have to count on the user having java script
8
3688
by: Mike Fellows | last post by:
Ok, im not sure if this is at all possible and if it is how i go about it is beyond me i have a piece of client side code that requires a piece of data from the server side (an ID number in this case) how can i pass the data from one side to the other, or retrieve it from the webform on the client side? i hope ive explained this properly
1
1629
by: Carl Jones via .NET 247 | last post by:
(Type your message here) I'm trying to run a client-side script from a web page. It's a VB script that gets information (computer name, software versions etc )about the computer and writes it to a txt file. If I simply run the script from a button click it gathers the information of the server, not the workstation, no matter what workstation I'm on. What am I missing? -------------------------------- From: Carl Jones ...
9
4921
by: Harry Smith | last post by:
While reading the documentation on IsStartupScriptRegistered, there is a reference to "client startup script" as "Determines if the client startup script is registered with the Page object." What is meant by "Client Start Script"? Thanks, Harry
7
1612
by: Mike Rand | last post by:
I am having a really hard time trying to get some client side code hooked up in VS2005, ASP 2.0. The code is in an .inc file (vbscript). The first problem I am encountering is the ASP.NET page doesn't like vbscript and throws fits about the syntax. Second, the page throws fits about the server side code tags (<% ... %>),...are these supported anymore? Third, when I set the onclick event of a client side HTML button it does not recognize...
3
1753
by: jesper_lofgren | last post by:
Hello, I have a problem, i have a event in asp.net codebehind file that updating a datasource. If that update went well i want to refresh my treeview thats on another page. The script works well, the problem is.... the client script runs before the updatemethod ! I give u some ex code here...
1
3168
by: Chris | last post by:
Hi, I have jsut started to learn ASP development and have read many articles regarding which is the best to use regarding JavaScript or VBScript. All of the learning that I have done so far has been using VBScript. I have done the usual database connection and querying stuff using VBScript in my tutorials and have noticed that my code doesnt work when using Mozilla Firefox as VBScript is a Micorsoft language and
5
13124
by: Ankur | last post by:
Hi Folks, I am new for this group. I want to clarify one thing what's a basic difference between Client Side Java Script and Server Side Java Script. how we can differentiate it. Why we called this kind of script "Server Side Java Script". I am in confusion because according to lots of web developer Java Script is a client side scripting language. We can not say it Server Side Java Script.
5
2165
by: Simon | last post by:
I heard that we could do that by using AJAX. Could anybody share how to do it? Thanks.
0
9721
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10640
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10376
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7662
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6881
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5689
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3861
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3015
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.