execute asp.net file in .html file

R

Rajiv Gupta

Hi,

We are moving from asp to asp.net.

In our existing model we execute the asp by including them in .html
files.
For example:
In abc.html file we include following directive:
<!--exec cgi="right_list.asp"-->

And the dynamic output comes on the .html page.

Please let us know what is the best possible solution in ASP.NET to
achive the same result.

Note:
We are aware of the asp.net user controls but that works only in .aspx
pages. I need to include/ execute the asp.net file in a .html file.

thanks & regards
Rajiv
 
S

Scott M.

Note:
We are aware of the asp.net user controls but that works only in .aspx
pages. I need to include/ execute the asp.net file in a .html file.

You don't do this in ASP.NET. ASP.NET is a completely different
architecture than ASP. If you want ASP.NET results, you need to get rid of
..html files and move to .aspx files.
 
D

David Kyle

Why in the world you would want to do this I don't understand. I would
highly recommend that you look at your website archetecture again.

None the less you could probiably acheive the same results by calling an
aspx page just the same.

abc.html
<!-- exec cgi="right_list.aspx" -->

If you're going to move from asp to asp.net then I would suggest that you
invest the extra amount of time to copy and paste the html from your old
pages into a new aspx page and add the dynamic contents as needed (either
though user controls or direct manipulation of <asp: controls). ASP.NET in
the way it was ment to be used will no doubt end up in less hastle overall.

Cheers!

David Kyle
www.chloemag.com
 
S

Scott M.

I doubt you could get away with the same syntax, since by definition
processing an .aspx file returns a complete web page
(<HTML><HEAD><TITLE>....). So, would find that you would have complete
pages nested inside other complete pages.
 
D

David Jessee

Use a User Control and place it at the top of the page.

Yes, folks, I know that's not the best way to do it...however, sometimes
when you're migrating, you can't do the entire thing at once.
 
S

Scott M.

Actually, that is the best way to do it. But, the OP (for some reason)
wants to stay with .htm files.
 
R

Rajiv Gupta

Hi,

Thanks you all for the responses.

The reason we want to stick with .html files is that the client for
which we need to implement this is a website with massive indexing of
its pages on various search engines.
Also, we feel that .html files do have some benefit on indexing on
search engines over any other dynamic pages (.aspx for example).

Further as pointed out by "Scott M" processing .aspx file as "exec
cgi" will render complete html eg. from <HTML> to </HTML>. That would
produce erronous page output and an invalid html page.

So, from the discussion held so far i think i will have to stay back
with .asp file for this particular task.

But i strongly feel that we should have some provision in asp.net (may
be some new extension for scripting files) to achive this task
(atleast for existing web applications).

thanks & regards
Rajiv
 
S

Scott M.

The reason we want to stick with .html files is that the client for
which we need to implement this is a website with massive indexing of
its pages on various search engines.

Also, we feel that .html files do have some benefit on indexing on
search engines over any other dynamic pages (.aspx for example).

Your pages will be re-indexed in a matter of weeks (sooner if you alert the
engies yourself). You could even have your .html files use the META tag to
forward a user to a new .aspx page. .html files have absolutley no extra
indexing benefits than .aspx pages do, as long as each page has appropriate
But i strongly feel that we should have some provision in asp.net (may
be some new extension for scripting files) to achive this task
(atleast for existing web applications).

Why? ASP.NET takes nothing away and only adds to your capabilities. In my
opinion, you really haven't given a compelling reason to stay with static
files, but if you are going to stay with them, you can't blame a new
technology for not providing an interface to static files.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,571
Members
45,045
Latest member
DRCM

Latest Threads

Top