473,408 Members | 1,822 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,408 software developers and data experts.

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=".html"
type="System.Web.Compilation.PageBuildProvider"
appliesTo="Web" />
</buildProviders>
</compilation>
<httpHandlers>
<add path="*.html"
verb="*"
type="System.Web.UI.PageHandlerFactory"
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.vb

Please help!

Thanks.

Nov 19 '05 #1
8 1593
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=".html"
type="System.Web.Compilation.PageBuildProvider"
appliesTo="Web" />
</buildProviders>
</compilation>
<httpHandlers>
<add path="*.html"
verb="*"
type="System.Web.UI.PageHandlerFactory"
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.vb

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=".html"
type="System.Web.Compilation.PageBuildProvider"
/>
</buildProviders>
</compilation>
<httpHandlers>
<add path="*.html"
verb="*"
type="System.Web.UI.PageHandlerFactory"
/>
</httpHandlers>

And , of course, add the file type in the "configuration" 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******@chriswelch.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.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=".html"
type="System.Web.Compilation.PageBuildProvider"
appliesTo="Web" />
</buildProviders>
</compilation>
<httpHandlers>
<add path="*.html"
verb="*"
type="System.Web.UI.PageHandlerFactory"
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.vb

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******@chriswelch.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.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
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...
6
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? --...
7
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...
9
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">...
1
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...
7
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
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...
59
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...
29
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...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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...
0
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,...
0
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...
0
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,...
0
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...
0
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...

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.