Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Building Controls > Any way to avoid mass conversion of #INCLUDE files to UserControls?

Reply
Thread Tools

Any way to avoid mass conversion of #INCLUDE files to UserControls?

 
 
JJA
Guest
Posts: n/a
 
      07-08-2004
I have a very large classic ASP site that is making heavy use of
server-side #INCLUDE of .ASP files within .ASP files. I've researched
and seen recommendations describing how you can convert all files to
be included to user controls and then change all including files to
use "register directives" at the top of the file and <UserControlxx>
wherever the #INCLUDE file resided in the <BODY of the page.

Furthermore, all "including files" would have to be changed from .ASP
to .ASPX files as I understand it. It gets progressively awkward if a
file is both a main or "including" .ASP file sometimes and is in other
cases #INCLUDEd by other main files.

My question is - Is there any other and easier way to handle a
conversion like this?

My immediate goal is to get this site - www.mortgagedataweb.com -
operational on a new platform - Win2003 Server WebEdition. I used the
IIS Migration Tool as a start but it appears to just copy files and
handle some IIS chores. I know the benefits of UserControls but now I
am trying to just get a site working fast.

Thanks in advance for guidance.
 
Reply With Quote
 
 
 
 
John Saunders
Guest
Posts: n/a
 
      07-08-2004
"JJA" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> I have a very large classic ASP site that is making heavy use of
> server-side #INCLUDE of .ASP files within .ASP files. I've researched
> and seen recommendations describing how you can convert all files to
> be included to user controls and then change all including files to
> use "register directives" at the top of the file and <UserControlxx>
> wherever the #INCLUDE file resided in the <BODY of the page.
>
> Furthermore, all "including files" would have to be changed from .ASP
> to .ASPX files as I understand it. It gets progressively awkward if a
> file is both a main or "including" .ASP file sometimes and is in other
> cases #INCLUDEd by other main files.
>
> My question is - Is there any other and easier way to handle a
> conversion like this?
>
> My immediate goal is to get this site - www.mortgagedataweb.com -
> operational on a new platform - Win2003 Server WebEdition. I used the
> IIS Migration Tool as a start but it appears to just copy files and
> handle some IIS chores. I know the benefits of UserControls but now I
> am trying to just get a site working fast.
>
> Thanks in advance for guidance.


Why not leave it as ASP? Nothing in the world is going to allow an ASP.NET
page to handle an included ASP file if that ASP file uses any features of
ASP which aren't compatible with ASP.NET.

Note that the Find In Files functionality of VS.NET can assist in mass
conversions. It supports regular expressions both in the search and replace
strings. You could first convert your include files into user controls, then
use Find In Files to search for the include and replace it with a
corresponding user control invocation. You could then either manually add
Register directives or paste in a standard series of Register directives.
--
John Saunders
johnwsaundersiii at hotmail


 
Reply With Quote
 
 
 
 
JJA
Guest
Posts: n/a
 
      07-09-2004
> Why not leave it as ASP? Nothing in the world is going to allow an ASP.NET
> page to handle an included ASP file if that ASP file uses any features of
> ASP which aren't compatible with ASP.NET.


Thank you - this is what I'd like to do - "leave it as ASP"! I'm
having trouble finding info on how to do that. Everything I find on
the subject talks about the merits of and the techniques of converting
to .ASPX and .ASCX.

Could you please sketch out how I get an "unconverted" ASP site
working as is under Win2003 Server running the newest versions of .Net
? I thought I saw a checkbox somewhere in IIS 6.0 labeled as "ASP". I
recall that it was checked.
 
Reply With Quote
 
John Saunders
Guest
Posts: n/a
 
      07-09-2004
x"JJA" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> > Why not leave it as ASP? Nothing in the world is going to allow an

ASP.NET
> > page to handle an included ASP file if that ASP file uses any features

of
> > ASP which aren't compatible with ASP.NET.

>
> Thank you - this is what I'd like to do - "leave it as ASP"! I'm
> having trouble finding info on how to do that. Everything I find on
> the subject talks about the merits of and the techniques of converting
> to .ASPX and .ASCX.
>
> Could you please sketch out how I get an "unconverted" ASP site
> working as is under Win2003 Server running the newest versions of .Net
> ? I thought I saw a checkbox somewhere in IIS 6.0 labeled as "ASP". I
> recall that it was checked.


Windows Server 2003 supports ASP. What happens when you just try it?

Try creating a site or virtual directory with a simple ASP page, like <%
Response.Write("Hello, World") %>.
--
John Saunders
johnwsaundersiii at hotmail


 
Reply With Quote
 
JJA
Guest
Posts: n/a
 
      07-12-2004
>
> Windows Server 2003 supports ASP. What happens when you just try it?
>
> Try creating a site or virtual directory with a simple ASP page, like <%
> Response.Write("Hello, World") %>.


I was able to create a site called TestASP with a single file called
index1.asp with one line as above and it responds with "Hello World".
When I try to browse my development ASP site, I get:

The page cannot be displayed
The page you are looking for is currently unavailable. The Web site
might be experiencing technical difficulties, or you may need to
adjust your browser settings.

Please try the following:

Click the Refresh button, or try again later. <blah..blah..blah>

Cannot find server or DNS Error
Internet Explorer

Here is a few lines snipped from the top of my index.asp page:

<%@ LANGUAGE=vbscript %>
<% Option Explicit %>
<!--#include file="CheckBrowser.asp" -->
<!--#include file="StyleSheet_Init0.asp" -->
<title>MortgageDataWeb - The Best Source for Market Share and Lender
Rankings</title>
<meta name="description" content="The WEB's most comprehensive
mortgage databases and market share reporting system (Conventional,
FHA, VA, and HMDA).">
<meta name="keywords" content="mortgage, market share, FHA/VA, HMDA,
market-share, lender, conventional, jumbo, conforming, loan-to-value">
<% if bNetscape = 1 then %>
<SCRIPT LANGUAGE="JavaScript">
.....etc....

When using Visual Studio.Net 2003 as an editor for this .ASP page, I
get sqiggly lines under all the HTML tags. For example, hovering under
the <title> tag gives the message "Per the active schema, the element
'title' must be included within a parent element". Could that be a
clue that I cannot run the ASP files as they are perhaps?
 
Reply With Quote
 
John Saunders
Guest
Posts: n/a
 
      07-13-2004
"JJA" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> >
> > Windows Server 2003 supports ASP. What happens when you just try it?
> >
> > Try creating a site or virtual directory with a simple ASP page, like <%
> > Response.Write("Hello, World") %>.

>
> I was able to create a site called TestASP with a single file called
> index1.asp with one line as above and it responds with "Hello World".
> When I try to browse my development ASP site, I get:
>
> The page cannot be displayed
> The page you are looking for is currently unavailable. The Web site
> might be experiencing technical difficulties, or you may need to
> adjust your browser settings.
>
> Please try the following:
>
> Click the Refresh button, or try again later. <blah..blah..blah>
>
> Cannot find server or DNS Error
> Internet Explorer
>
> Here is a few lines snipped from the top of my index.asp page:
>
> <%@ LANGUAGE=vbscript %>
> <% Option Explicit %>
> <!--#include file="CheckBrowser.asp" -->
> <!--#include file="StyleSheet_Init0.asp" -->
> <title>MortgageDataWeb - The Best Source for Market Share and Lender
> Rankings</title>
> <meta name="description" content="The WEB's most comprehensive
> mortgage databases and market share reporting system (Conventional,
> FHA, VA, and HMDA).">
> <meta name="keywords" content="mortgage, market share, FHA/VA, HMDA,
> market-share, lender, conventional, jumbo, conforming, loan-to-value">
> <% if bNetscape = 1 then %>
> <SCRIPT LANGUAGE="JavaScript">
> ....etc....
>
> When using Visual Studio.Net 2003 as an editor for this .ASP page, I
> get sqiggly lines under all the HTML tags. For example, hovering under
> the <title> tag gives the message "Per the active schema, the element
> 'title' must be included within a parent element". Could that be a
> clue that I cannot run the ASP files as they are perhaps?


<title> should be inside of <head>, which should be inside of <html>. Take a
look at your include files to see if one of them contains <html> and <head>.
If one does, then perhaps it is not being processed as an include file.

Also, you might now want to add to your index1.asp step by step, bringing it
closer and closer to the page that doesn't work. At some point, it will stop
working, and that will be a big clue. I try to do this like a binary search.
When I add a chunk and it fails, I then remove half of the chunk I added and
see if it fails. If so, I remove half again, but if not, I add half of the
half chunk I removed...
--
John Saunders
johnwsaundersiii at hotmail


 
Reply With Quote
 
JJA
Guest
Posts: n/a
 
      07-15-2004
> <title> should be inside of <head>, which should be inside of <html>. Take a
> look at your include files to see if one of them contains <html> and <head>.
> If one does, then perhaps it is not being processed as an include file.


That's correct. My #INCLUDE files generate the <html> and <head> tags
along with different stylesheets depending on the browser detected. I
guess I don't really know what to expect here. For example, if I OPEN
a .ASP file in Visual Studio.Net and it immediately gives me squiggly
lines it suggests this "editor" cannot see the "runtime effect" of the
#INCLUDE file(s) inclusion. Visual Interdev 6.0 of course never
"complained" about constructs like this. Granted, VS.Net is made for
more powerful things than classic .ASP with #INCLUDEs but is there a
"best practice" or guideline about how to nurse one's old ASP
applications through an existence under VS.NET? For example, should
you use NOTEPAD for editing .ASP files? That is, do you just "put up
with" the apparent inability for VS.Net to recognize that #INCLUDE has
not yet been processed and therefore the HTML tags are naturally going
to be only partially correct?
 
Reply With Quote
 
John Saunders
Guest
Posts: n/a
 
      07-15-2004
"JJA" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> > <title> should be inside of <head>, which should be inside of <html>.

Take a
> > look at your include files to see if one of them contains <html> and

<head>.
> > If one does, then perhaps it is not being processed as an include file.

>
> That's correct. My #INCLUDE files generate the <html> and <head> tags
> along with different stylesheets depending on the browser detected. I
> guess I don't really know what to expect here. For example, if I OPEN
> a .ASP file in Visual Studio.Net and it immediately gives me squiggly
> lines it suggests this "editor" cannot see the "runtime effect" of the
> #INCLUDE file(s) inclusion. Visual Interdev 6.0 of course never
> "complained" about constructs like this. Granted, VS.Net is made for
> more powerful things than classic .ASP with #INCLUDEs but is there a
> "best practice" or guideline about how to nurse one's old ASP
> applications through an existence under VS.NET? For example, should
> you use NOTEPAD for editing .ASP files? That is, do you just "put up
> with" the apparent inability for VS.Net to recognize that #INCLUDE has
> not yet been processed and therefore the HTML tags are naturally going
> to be only partially correct?


I think you're going to get into trouble with #include files which generate
so much of the page structure. You should really work towards not using them
at all (as the subject of this post suggests), but I'd most strongly suggest
that you get rid of any #include files which do things so different from
what ASP.NET does.

Note that ASP.NET does everything as controls. A control doesn't generate
some arbitrary string of text which may or may not be contributing to a
valid stream of HTML. Instead, controls usually generate something
self-contained. They generate something which would be valid if the control
were moved somewhere else.

So, it would be tolerable if your #include file were to generate some tags
within the <head> area, or some tags within the <body> area, or if it
generated a <td> ... </td>, or a <tr> ... </tr>, or <table> ... </table>, or
something self-contained like that.
--
John Saunders
johnwsaundersiii at hotmail


 
Reply With Quote
 
JJA
Guest
Posts: n/a
 
      07-16-2004
> "JJA" <(E-Mail Removed)> wrote in message
> > you use NOTEPAD for editing .ASP files? That is, do you just "put up
> > with" the apparent inability for VS.Net to recognize that #INCLUDE has
> > not yet been processed and therefore the HTML tags are naturally going
> > to be only partially correct?

>

Thanks very much for your input on this. I follow what you mean about
"self-contained functionality" and for the most part I've tried to
make the output of a given INCLUDE file a separate piece of
functionality.

I intend to get to ASP.NET user controls but the thrust of my question
has been how to get the ASP simply working at all. I now know a bit
more of what to expect. Part of my problem was that the IIS 6.0
Migration Utility messed up part of my metabase. I think it is OK now.

In summary, I'd love to hear your comments on the "squiggly line
complaints" of the VS.Net editor that I raised in the post above. Is
it best practice to just ignore that, use Interdev, use NotePad, or is
there some tweak to VS.Net to get it to "calm down" when simply
editing an old .ASP file with some of the HTML not fully developed
until runtime?
 
Reply With Quote
 
John Saunders
Guest
Posts: n/a
 
      07-16-2004
"JJA" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> > "JJA" <(E-Mail Removed)> wrote in message
> > > you use NOTEPAD for editing .ASP files? That is, do you just "put up
> > > with" the apparent inability for VS.Net to recognize that #INCLUDE has
> > > not yet been processed and therefore the HTML tags are naturally going
> > > to be only partially correct?

> >

> Thanks very much for your input on this. I follow what you mean about
> "self-contained functionality" and for the most part I've tried to
> make the output of a given INCLUDE file a separate piece of
> functionality.
>
> I intend to get to ASP.NET user controls but the thrust of my question
> has been how to get the ASP simply working at all. I now know a bit
> more of what to expect. Part of my problem was that the IIS 6.0
> Migration Utility messed up part of my metabase. I think it is OK now.
>
> In summary, I'd love to hear your comments on the "squiggly line
> complaints" of the VS.Net editor that I raised in the post above. Is
> it best practice to just ignore that, use Interdev, use NotePad, or is
> there some tweak to VS.Net to get it to "calm down" when simply
> editing an old .ASP file with some of the HTML not fully developed
> until runtime?


Ignore the squiggly lines until you get further in your conversion. Once
things have calmed down a bit, you'll find many of the squiggly lines to be
useful. For instance, a web site I know of, converted from ASP, used to have
several invalid attributes on the <body> tags. We happen not to have
received any complaints from customers who saw a strange site.
--
John Saunders
johnwsaundersiii at hotmail


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
is there any way to avoid __VIEWSTATE hidden field in the page reju ASP .Net 7 03-06-2007 11:44 AM
501 PIX "deny any any" "allow any any" Any Anybody? Networking Student Cisco 4 11-16-2006 10:40 PM
Avoid having a SQL express for web parts and avoid personalization Roger23 ASP .Net 2 10-12-2006 10:54 PM
Mass conversion of NEF files to TIF ??? Anonymous Digital Photography 1 01-04-2005 12:28 PM
Avoid wasting time or how to avoid initialization Alexander Malkis C++ 8 04-13-2004 11:23 PM



Advertisments