Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Your security settings do not allow websites to use ActiveX contro

Reply
Thread Tools

Your security settings do not allow websites to use ActiveX contro

 
 
=?Utf-8?B?UGhpbGxpcCBXaWxsaWFtcw==?=
Guest
Posts: n/a
 
      09-21-2007

I have already set the Internet Options->Advanced ->Security to "Allow
active content to run in files on My Computer" and restarted the browser.

If I navigate using the browser to the website that contains the ActiveX,
the ActiveX is loaded and the website works fine.

However if I run a web test created using VS Team Suite or run a Load test
of the same web test within VS, the ActiveX is not loaded on the page and
this warning keeps popping up:

"Your security settings do not allow websites to use ActiveX controls
installed on your computer"

Does anyone have an idea how to force VS to accept the same settings as the
Internet Options and allow the ActiveX to load on the page being tested?

--
Regards,

Phillip Williams (MCPD Web Developer)
http://mcts-study-practices.com/
http://www.webswapp.com
 
Reply With Quote
 
 
 
 
Walter Wang [MSFT]
Guest
Posts: n/a
 
      09-24-2007
Hi Phillip,

Could you please tell me more about your system configuration:

* which IE version
* which os, 32-bit or 64-bit
* which type of ActiveX control that you're using?

According to this document, we have three types of ActiveX control and some
of them may need to special treatment to work with Webtest:

http://msdn2.microsoft.com/en-us/lib...78(VS.80).aspx
<quote>
ActiveX controls in your Web application will fall into three categories,
depending on how they work at the HTTP level.

...
</quote>




Sincerely,
Walter Wang (, remove 'online.')
Microsoft Online Community Support

==================================================
For MSDN subscribers whose posts are left unanswered, please check this
document: http://blogs.msdn.com/msdnts/pages/postingAlias.aspx

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications. If you are using Outlook Express/Windows Mail, please make sure
you clear the check box "Tools/Options/Read: Get 300 headers at a time" to
see your reply promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

 
Reply With Quote
 
 
 
 
=?Utf-8?B?UGhpbGxpcCBXaWxsaWFtcw==?=
Guest
Posts: n/a
 
      09-24-2007
Thanks Walter for your response and the helpful article that you posted.

I am using IE 7 on Win XP 32-bit. The ActiveX control does not work at the
Http level rather it performs a function on the desktop. I am also using SSL
but disabled it while recording the test so that I can use “Fiddler” to see
what kind of request syntax needed to be added to the webtest to get the
ActiveX cab file.

I added within the web test a dependent GET request with its URL value set
to https://mydomainname.com/folder1/MyActiveX.cab

This step succeeds in getting the cab file when the test runs.

I have a client-side JavaScript function on the page that detects if the
ActiveX is installed when the user visits the website then calls an AJAX
webservice method to log a record. The client-side JavaScript snippet looks
like this:

if (ActiveXIsInstalled()) {
//call an AJAX webservice method
MyAjaxWebService.MyActiveXIsInstalled(true);
}

When I run the web test, I do not get the expected log record (which means
that the JavaScript condition evaluated to false and consequently the AJAX
webservice method was not called); which tells me that the web test did not
load the ActiveX (even though I have the ActiveX installed and the step that
requests the cab file succeeded). I could still see on the “Test completed”
display window the warning message that “Your user settings do not allow
websites to use ActiveX controls installed on your computer…”


--
Regards,

Phillip Williams (MCPD Web Developer)
http://mcts-study-practices.com/
http://www.webswapp.com


""Walter Wang [MSFT]"" wrote:

> Hi Phillip,
>
> Could you please tell me more about your system configuration:
>
> * which IE version
> * which os, 32-bit or 64-bit
> * which type of ActiveX control that you're using?
>
> According to this document, we have three types of ActiveX control and some
> of them may need to special treatment to work with Webtest:
>
> http://msdn2.microsoft.com/en-us/lib...78(VS.80).aspx
> <quote>
> ActiveX controls in your Web application will fall into three categories,
> depending on how they work at the HTTP level.
>
> ...
> </quote>
>
>
>
>
> Sincerely,
> Walter Wang (, remove 'online.')
> Microsoft Online Community Support
>
> ==================================================
> For MSDN subscribers whose posts are left unanswered, please check this
> document: http://blogs.msdn.com/msdnts/pages/postingAlias.aspx
>
> Get notification to my posts through email? Please refer to
> http://msdn.microsoft.com/subscripti...ult.aspx#notif
> ications. If you are using Outlook Express/Windows Mail, please make sure
> you clear the check box "Tools/Options/Read: Get 300 headers at a time" to
> see your reply promptly.
>
> Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
> where an initial response from the community or a Microsoft Support
> Engineer within 1 business day is acceptable. Please note that each follow
> up response may take approximately 2 business days as the support
> professional working with you may need further investigation to reach the
> most efficient resolution. The offering is not appropriate for situations
> that require urgent, real-time or phone-based interactions or complex
> project analysis and dump analysis issues. Issues of this nature are best
> handled working with a dedicated Microsoft Support Engineer by contacting
> Microsoft Customer Support Services (CSS) at
> http://msdn.microsoft.com/subscripti...t/default.aspx.
> ==================================================
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
>

 
Reply With Quote
 
Walter Wang [MSFT]
Guest
Posts: n/a
 
      09-25-2007
Hi Phillip,

I'm not sure, you mentioned that HTTPS is not used, but the cab is still
downloaded from SSL? Also, how're you testing if the ActiveX is installed
or not? Have you tried to add the site into the Trusted Sites zone and
lower the security settings there?

Can you send me a reprodicuble project to help me reproduce the issue on my
side? Thanks.


Regards,
Walter Wang (, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

 
Reply With Quote
 
=?Utf-8?B?UGhpbGxpcCBXaWxsaWFtcw==?=
Guest
Posts: n/a
 
      09-25-2007
I sent you by email the entire project for a simple representative scenario
that:
- loads the Media Player on the default.aspx
- Test if the Media Player is loaded then call an AJAX webservice function
that saves a session variable
- Navigates to Page2 that tests if the Session variable is null or has a value
- Add a test project and create a webtest.
- Run the webtest to verify that the Session variable is null (i.e. the
webtest did not load the Media Player) but if you were to navigate to the
website without the webtest the media player will be loaded and the Session
variable will be set


Here are the steps to create this simple test project:
1- Create an Ajax-enabled website
2- Add a New Item->Web Service then enter the following code:

using System;
using System.Web;
using System.Collections;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Web.Script.Services;


/// <summary>
/// Summary description for WebService
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[ScriptService]
public class WebService : System.Web.Services.WebService {

public WebService () {

//Uncomment the following line if using designed components
//InitializeComponent();
}

[SoapDocumentMethod(OneWay = true)]
[WebMethod(Description = "Saves a session variable named
LocalSSLInstalled with either true or false",
EnableSession = true)]
public void IsActiveXInstalled(bool isInstalled) {
Context.Session["MediaPlayerIsLoaded"] = isInstalled;
}

}

3- Create a new page “page2.aspx”, add a label server control “lblStatus”
and the following code in the Page_Load event:

if (Session["MediaPlayerIsLoaded"] != null)
{
lblStatus.Text = "The session variable named MediaPlayerIsLoaded
contains a value of " + Session["MediaPlayerIsLoaded"].ToString();
}
else
{
lblStatus.Text = "The session variable is null which means that
the ActiveX was not loaded and the AJAX function was not called";
}
4- In the default.aspx add the following markup to put the Media Player
ActiveX control to the page and when the page is loaded it will test if the
Media Player was loaded it calls the Javascript function above.

<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
<Services>
<asp:ServiceReference Path="WebService.asmx" />
</Services>
</asp:ScriptManager>
<div>
<div id="d_main" />
<asp:Button ID="btnMove" runat="server" Text="Move to next Page"
OnClick="btnMove_Click" />
</div>
</form>

<script type="text/javascript">
var r=document.getElementById('d_main');
var k=document.createElement('object');
k.setAttribute('id','mplayer');
k.setAttribute('width','320');
k.setAttribute('height','286');
k.setAttribute('classid','CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95');
k.setAttribute('standby','Loading Windows Media Player components...');
k.setAttribute('type','application/x-oleobject');

k.setAttribute('codebase','http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112');
r.appendChild(k);
var mplayer = document.getElementById ("mplayer");
if (mplayer)
{
alert("found player");
WebService.IsActiveXInstalled(true);
}
</script>

--
Regards,

Phillip Williams (MCPD Web Developer)
http://mcts-study-practices.com/
http://www.webswapp.com


""Walter Wang [MSFT]"" wrote:

> Hi Phillip,
>
> I'm not sure, you mentioned that HTTPS is not used, but the cab is still
> downloaded from SSL? Also, how're you testing if the ActiveX is installed
> or not? Have you tried to add the site into the Trusted Sites zone and
> lower the security settings there?
>
> Can you send me a reprodicuble project to help me reproduce the issue on my
> side? Thanks.
>
>
> Regards,
> Walter Wang (, remove 'online.')
> Microsoft Online Community Support
>
> ==================================================
> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> ==================================================
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
>

 
Reply With Quote
 
Walter Wang [MSFT]
Guest
Posts: n/a
 
      09-27-2007
Hi Phillip,

Thank you for your code. I've done some test locally and found out it's not
an issue related to the ActiveX Control, but to the fact that currently
WebTest cannot record AJAX calls from the web page.

Here's my test steps and a workaround to fix this issue:

1) Create an AJAX enabled WebSite
2) Add a WebService:

<%@ WebService Language="C#" Class="WebService" %>

using System;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Web.Script.Services;

[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[ScriptService]
public class WebService : System.Web.Services.WebService {

[WebMethod()]
public string HelloWorld() {
return "Hello World";
}

[SoapDocumentMethod(OneWay=true)]
[WebMethod(EnableSession=true)]
public void SetSessionState(string name, object value) {
Session[name] = value;
}

[WebMethod(EnableSession=true)]
public object GetSessionState(string name) {
return Session[name];
}
}

3) Add a WebForm:

<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

protected void Page_Load(object sender, EventArgs e)
{

}

protected void Button1_Click(object sender, EventArgs e)
{
if (Session["foo"] != null)
{
Label1.Text = Session["foo"] as string;
}
}
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
<script type="text/javascript" language="javascript">
function HelloWorldCallback(result)
{
document.getElementById("result").innerHTML = result;
}
function GetSessionStateCallback(result)
{
document.getElementById("result").innerHTML = result;
}
</script>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
<Services>
<asp:ServiceReference Path="WebService.asmx" />
</Services>
</asp:ScriptManager>

<div id="result">Result</div>
<input type="button"
onclick="WebService.HelloWorld(HelloWorldCallback) " value="Hello World" />
<input type="button" onclick="WebService.SetSessionState('foo',
'bar')" value="SetSessionState" />
<input type="button" onclick="WebService.GetSessionState('foo',
GetSessionStateCallback)" value="GetSessionState" />
<asp:Button ID="Button1" runat="server" Text="PostBack"
OnClick="Button1_Click" />
<asp:Label ID="Label1" runat="server"></asp:Label>

</form>
</body>
</html>

4) Test Default.aspx in IE, after you click button "SetSessionState", click
on button "PostBack" and verify the session state variable 'foo' set in
WebService can be read by WebForm.

5) Now create Test project and add a WebTest to record a test: click button
"SetSessionState", click button "PostBack"

6) If you now run the WebTest in Visual Studio, at the end, the session
state variable 'foo' doesn't get retrieved back successfully since it's
actually not set at all.

Now the workaround:

1) Install latest version of Fiddler (http://www.fiddlertool.com/)
2) Launch Fiddler before recording the WebTest
3) After you finished recording, find the "session" (don't confuse this
with ASP.NET session, it's a session in Fiddler's "Web Sessions" window) in
fiddler that represents the Ajax call (requesting WebService.asmx),
right-click on it and select menu "Save/Session/as Visual Studio WebTest".
4) In your Visual Studio test project, add this saved webtest and open it,
then copy the request and paste into your previously recorded webtest, make
sure you order the requests correctly.
5) Now re-run the webtest, in the end, it should correctly display the
session state variable's value.


I hope I haven't misunderstood anything, since I didn't encounter the
ActiveX Control security warning as you described previously.



Regards,
Walter Wang (, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Settings.settings file with settings for multiple regions donet programmer ASP .Net 3 11-20-2009 03:05 PM
Where to find the documentation of existing windows activeX contro =?Utf-8?B?ZGF2aWQ=?= ASP .Net 0 02-21-2006 07:07 PM
Service Contro Managerl Events are not logged Hank Computer Support 3 10-26-2005 06:39 PM
ActiveX apologetic Larry Seltzer... "Sun paid for malicious ActiveX code, and Firefox is bad, bad bad baad. please use ActiveX, it's secure and nice!" (ok, the last part is irony on my part) fernando.cassia@gmail.com Java 0 04-16-2005 10:05 PM
Please help with security settings & ActiveX Drknight2004 Computer Support 3 04-09-2004 06:15 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57