473,378 Members | 1,470 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

webbrowser control and HTC (html component file)

Hi,

Is it possible to access an htc file from the windows webbrowser control? I
am receiving the following error:

"An error has occurred in the script on this page."
"Error: Access is denied to [path]"
"Url: about:blank"

I am able to access the htc file when i run the host web page as a normal
html file, (outside of the webbrowser control).
But when i try to load that html string as document text in my webbrowser
control, I receive the above error.

I have tried the following approaches :
- make htc reference local e.g. LI {behavior:url('hilite.htc')}
- make htc reference absolute e.g. LI {behavior:url('C:\Documents and
Settings\erika.hobbs\Desktop\HTML_components\hilit e.htc')}
- make htc reference via a website url e.g. LI
{behavior:url('http://mysite/HTCResources/hilite.htc')}
- access a resource library e.g. { behavior: url(
"res://Resource.dll/hilite.HTC" ) }

Below is my exact code:
hilite.htc:

<PUBLIC:COMPONENT>
<PUBLIC:ATTACH EVENT="onmouseover" ONEVENT="Hilite()" />
<PUBLIC:ATTACH EVENT="onmouseout" ONEVENT="Restore()" />
<SCRIPT LANGUAGE="JScript">
var normalColor, normalSpacing;

function Hilite()
{
// save original values
normalColor = runtimeStyle.color;
normalSpacing= runtimeStyle.letterSpacing;

runtimeStyle.color = "red";
runtimeStyle.letterSpacing = 2;
}

function Restore()
{
// restore original values
runtimeStyle.color = normalColor;
runtimeStyle.letterSpacing = normalSpacing;
}
</SCRIPT>
</PUBLIC:COMPONENT>

Host page: main.htm
<HTML>
<HEAD>
<STYLE>
LI {behavior:url('hilite.htc')}
</STYLE>
</HEAD>
<BODY>
<P>Mouse over the two list items below to see this effect.
<UL>
<LI>HTML Authoring</LI>
<LI>Dynamic HTML</LI>
</UL>
</BODY>
</HTML>

Please help.

Many thanks.
Jun 27 '08 #1
0 1809

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

Similar topics

1
by: Vetrivel | last post by:
Application architecture : Develop interface between two existing systems, a. Enterprise CRM system b. Web based intranet system. Environment : Intranet Server : IIS and ASP. Script :...
1
by: boxim | last post by:
Hi All, Just after some other opinions really.... We're writing this application that in places implements the WebBrowser control to make certain bits look nicer as well as make things quicker...
3
by: c j anderson, mcp | last post by:
I recently had a need to be able to highlight selected text in a web browser control (working code is posted below). Attempts to access the modified html source through the webbrowser or the...
6
by: ESmith | last post by:
I'm looking to user a web browser component in VS2005. I like the functionality in the AXWebBrowser component (from ActiveX controls page) that allows me to do this: mshtml.HTMLDocument doc; ...
12
by: Alex Clark | last post by:
Greetings, (.NET 2.0, WinXP Pro/Server 2003, IE6 with latest service packs). I've decided to take advantage of the layout characteristics of HTML documents to simplify my printing tasks, but...
15
by: Laurent Lequenne | last post by:
Hello All, I'm currently developing a free windows Scrabble (in french :)) application that uses extensively the WebBrowser class of NET 2.0 for configuration, and data browsing. It works 100%...
5
by: ThisBytes5 | last post by:
I have an application that uses the web browser component in VS 2005. I know this is just a wrapper for the com component. What I need to do is control wether or not the images on the navigated...
6
by: titan.nyquist | last post by:
The WebBrowser control won't load a css file written in the same directory as the program. If I put an absolute path to it, it will load it. Thus, the current directory of the WebBrowser control...
3
by: =?Utf-8?B?R2F1cmF2?= | last post by:
I am using the AxSHDocVw.AxWebBrowser control (named PreviewBrowser) in my C# app to load a pdf file: PreviewBrowser.Navigate(strPDF ,ref objNull,ref objNull,ref objNull,ref objNull); These PDF...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.