473,698 Members | 2,972 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HTML Extension for ASP.NET 2.0

I am trying to map ASP.NET execution to the ".html" extension. And I am
encountering a strange error. I'm looking for help configuring my
".html" pages to execute as ".aspx" pages.

I have added the IIS file extension mapping, I have also added the
following to the Web.Config file:

<compilation>
<buildProviders >
<add extension=".htm l"
type="System.We b.Compilation.P ageBuildProvide r"
appliesTo="Web" />
</buildProviders>
</compilation>
<httpHandlers >
<add path="*.html"
verb="*"
type="System.We b.UI.PageHandle rFactory"
validate="True" />
</httpHandlers>

In my .html pages I receive a context error (example: "'Context' is not
a member of 'Default4'"), yet my page is wired up just like any other
normal aspx page, which do not receive any error.

Example file names: Default4.html, Default4.html.v b

Please help!

Thanks.

Nov 19 '05 #1
8 1605
I just setup an application just as you've described and it works just fine
for me. I'm using Beta2. Perhaps there's something else going on?

-Brock
DevelopMentor
http://staff.develop.com/ballen
I am trying to map ASP.NET execution to the ".html" extension. And I
am encountering a strange error. I'm looking for help configuring my
".html" pages to execute as ".aspx" pages.

I have added the IIS file extension mapping, I have also added the
following to the Web.Config file:

<compilation>
<buildProviders >
<add extension=".htm l"
type="System.We b.Compilation.P ageBuildProvide r"
appliesTo="Web" />
</buildProviders>
</compilation>
<httpHandlers >
<add path="*.html"
verb="*"
type="System.We b.UI.PageHandle rFactory"
validate="True" />
</httpHandlers>
In my .html pages I receive a context error (example: "'Context' is
not a member of 'Default4'"), yet my page is wired up just like any
other normal aspx page, which do not receive any error.

Example file names: Default4.html, Default4.html.v b

Please help!

Thanks.


Nov 19 '05 #2
Interesting. I am also using Beta2. How are you running your pages? Do
they have to be precompiled, or can I run them uncompiled as usual?

Nov 19 '05 #3
I ran w/o precompile using Cassini (the built-in development webserver).

-Brock
DevelopMentor
http://staff.develop.com/ballen
Interesting. I am also using Beta2. How are you running your pages? Do
they have to be precompiled, or can I run them uncompiled as usual?


Nov 19 '05 #4
It looks like the "appliesTo" and "validate"
properties have been deprecated.

Try :

<compilation>
<buildProviders >
<add extension=".htm l"
type="System.We b.Compilation.P ageBuildProvide r"
/>
</buildProviders>
</compilation>
<httpHandlers >
<add path="*.html"
verb="*"
type="System.We b.UI.PageHandle rFactory"
/>
</httpHandlers>

And , of course, add the file type in the "configurat ion" option
for the application in the Internet Service Manager.

That's the way I set up my custom extension ".juan"

Check it out :

http://asp.net.do/test/version.juan

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
=============== =======

"guppywon" <gu******@chris welch.com> wrote in message
news:11******** **************@ g14g2000cwa.goo glegroups.com.. .
I am trying to map ASP.NET execution to the ".html" extension. And I am
encountering a strange error. I'm looking for help configuring my
".html" pages to execute as ".aspx" pages.

I have added the IIS file extension mapping, I have also added the
following to the Web.Config file:

<compilation>
<buildProviders >
<add extension=".htm l"
type="System.We b.Compilation.P ageBuildProvide r"
appliesTo="Web" />
</buildProviders>
</compilation>
<httpHandlers >
<add path="*.html"
verb="*"
type="System.We b.UI.PageHandle rFactory"
validate="True" />
</httpHandlers>

In my .html pages I receive a context error (example: "'Context' is not
a member of 'Default4'"), yet my page is wired up just like any other
normal aspx page, which do not receive any error.

Example file names: Default4.html, Default4.html.v b

Please help!

Thanks.

Nov 19 '05 #5
The context error I am receiving is in Visual Studio 2005, and I am
trying to run the site using IIS. Do I need to do anything within
Visual Studio to support .html, or are my pages going to be
second-class citizens as with VS2003?

Nov 19 '05 #6
I don't understand your problem.

If your problem is that you want to create Html pages, go to the
File menu, then New, File, and select the HTML Page template.

Simply adding the "L" to the default .HTM filename lets you
build HTML pages and you'll have standard HTML objects
at your disposal which you can include in your HTML page.

Any HTML object which you insert will have a set of properties
which you can define in the Visual Studio Property box.

If you want to write JavaScript, you can do that, too,
although there's no additional help for that.

So, support for HTML files *is* there.

If your problem is that you want HTML files processed by
the ASP.NET engine, you *can* do that as I showed you.

I don't know of any way for Visual Studio to recognize custom
file extensions so that Intellisense, etc., work when a custom
extension is loaded ( Is that what you consider the problem to be ?).

You might workaround that by writing your code in an aspx file,
and renaming the file to the html extension when it's working.

If you setup the html extension per the instructions I sent you,
the pages *will* run, since your clients won't be using VS.NET
to run your pages, but their browsers.

Bottom line: VS.NET is behaving as it should, as I see it.

If you differ, please explain what you
would like VS.NET to do with HTML files.


Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
=============== =======

"guppywon" <gu******@chris welch.com> wrote in message
news:11******** **************@ f14g2000cwb.goo glegroups.com.. .
The context error I am receiving is in Visual Studio 2005, and I am
trying to run the site using IIS. Do I need to do anything within
Visual Studio to support .html, or are my pages going to be
second-class citizens as with VS2003?

Nov 19 '05 #7
I don't have the rest of this thread, but I seem to recall that you said
you made the mappings in IIS for .html files to the ASP.NET ISAPI (make sure
it's the 2.0 version).

Just to see if everything's ok, I'd suggest starting from scratch. Make a
FileSystem project (that was you don't have IIS to worry about) and make
a simple .aspx and then switch it all over to .html and see if that works.
I'm thinking that you'll have to take these little steps to isolate the problem.

-Brock
DevelopMentor
http://staff.develop.com/ballen
The context error I am receiving is in Visual Studio 2005, and I am
trying to run the site using IIS. Do I need to do anything within
Visual Studio to support .html, or are my pages going to be
second-class citizens as with VS2003?


Nov 19 '05 #8
I was finally able to get it to work. I accidently misconfigured IIS,
and simply had to fix the mistake.

Nov 19 '05 #9

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

Similar topics

4
4851
by: Ratsky | last post by:
HELP! I have used many HTML editors but have not found one that handles PHP pages well. Coffee Cup HTML editor used to be my HTML editor of choice, but it will not open pages with the .php extension and when I try to add .php as an extension that it will recognize, it crashes. ANYWAY, what HTML editor will save pages as .php by default? I have tried dreamweaver but it won't default to .php either, at least as near as I can tell. Thanks a...
6
5461
by: Els | last post by:
If I use <? include "file.html"; ?> in the html of my document, do I _have_ to change the extension of that document to .php, or would it still work and be valid if I let it remain .html? -- Els Mente humana é como pára-quedas; funciona melhor aberta.
7
7123
by: TLMM | last post by:
I have an HTML page which is a newsletter. I want to be able to add it to an email message so I can email it to people. I want it to be in the body of the email, not sent as an attachment. There is a .htm page, several images, and a .css page. I need all of these to be embedded for the page to work correctly. I can put the styles from the ..css file into the html page, but I still need to know how to embed the images. I tried creating...
9
13403
by: David D. | last post by:
Does the file extension matter when including a JavaScript file in an HTML page? Normally, one would include a JavaScript file in an HTML page using <script src="foo.JS" type="text/javascript"> However, I have found that I can use an alternate file extension, such as <script src="foo.HTML" type="text/javascript"> It works fine with my IE 6 and Mozilla. Will it work with other browsers?
1
2732
by: Arsen V. | last post by:
> Hello, > > How to control the structure of the HTML inside of the ItemTemplate of the > Repeater? > > For example, if a certain data column value is empty (or contains some > specific string or number), I want to be able to "hide" a part of the HTML > of the ItemTemplate. > > Say a customer has phone number and extension. The extension is optional.
7
1470
by: Shaul Feldman | last post by:
Hello, the question is how can I masquerade ASPX files behind HTML extension? Thank you in advance. -- With the best wishes, Shaul Feldman
6
2863
by: William F. Zachmann | last post by:
We've got a project going that involves moving an old web site with a massive dll written in C++ that produces most of the output from a SQL 7.0 data base on NT4 onto IIS on Windows 2003 Server with SQL 2000. All new code is being written in C# using ASP.NET and we are using forms authentication to control access to particular directories/applications. We are having a hard time figuring out how to configure the thing so that existing...
59
6998
by: Lennart Björk | last post by:
Hi All, I have a tiny program: <!doctype HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>MyTitle</title> <meta http-equiv="Content-Type" content="text/html;
29
2142
by: lenbell | last post by:
It's old stupid and lazy here again I have been wanting to keep using my WYSIWYG (What You See Is What You Get - for my fellow stupids) html editor. But I was told that you HAD to rename your files to .PHP so they would be parsed correctly. Oh contraire if you are hosted by Apache and have some access to the .htaccess file mechanism In my case through the "cPanel" and then "Apache Handlers"
0
8683
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
8611
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9170
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
9031
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
8904
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7741
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5867
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
4372
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...
3
2007
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.