By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,354 Members | 1,042 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,354 IT Pros & Developers. It's quick & easy.

execute asp.net file in .html file

P: n/a
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
Nov 18 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
> 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.
Nov 18 '05 #2

P: n/a
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
"Rajiv Gupta" <ra**********@gmail.com> wrote in message
news:e4**************************@posting.google.c om...
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

Nov 18 '05 #3

P: n/a
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.
"David Kyle" <dk***@chloemag.com> wrote in message
news:eT**************@TK2MSFTNGP09.phx.gbl...
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
"Rajiv Gupta" <ra**********@gmail.com> wrote in message
news:e4**************************@posting.google.c om...
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


Nov 18 '05 #4

P: n/a
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.
"Rajiv Gupta" <ra**********@gmail.com> wrote in message
news:e4**************************@posting.google.c om...
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

Nov 18 '05 #5

P: n/a
Actually, that is the best way to do it. But, the OP (for some reason)
wants to stay with .htm files.

"David Jessee" <dj*****@houston.rr.com> wrote in message
news:e0**************@TK2MSFTNGP15.phx.gbl...
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.
"Rajiv Gupta" <ra**********@gmail.com> wrote in message
news:e4**************************@posting.google.c om...
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


Nov 18 '05 #6

P: n/a
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

"Scott M." <s-***@nospam.nospam> wrote in message news:<ui**************@TK2MSFTNGP10.phx.gbl>...
Actually, that is the best way to do it. But, the OP (for some reason)
wants to stay with .htm files.

"David Jessee" <dj*****@houston.rr.com> wrote in message
news:e0**************@TK2MSFTNGP15.phx.gbl...
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.
"Rajiv Gupta" <ra**********@gmail.com> wrote in message
news:e4**************************@posting.google.c om...
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


Nov 18 '05 #7

P: n/a
> 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
meta data using the <META> tag. There is just simply no reason to stay with
..html files.
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.
Nov 18 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.