Morgan;
Appreciate your contribution. At the same time, have a Question.
I am working in ASP.NET with aim of converting an Access database
application to a Web application so that users do not need to have
either Access or a LAN connection to the supporting instance of
SQL Server. I did not have any prior experience with ASP. The first
times that I tried to wade through the Wrox Press books
Professional C# and Professional C#, they constituted a pretty
stiff dose, so I focused on what I thought I needed and ignored
user controls. It happens that I ran into a problem with one of
my DHTML include files concurrent with receiving the comments from
you and from Doug Seven promoting user controls. So I converted one
of the include files to a user control to see if that would help.
It turned out that my problem with the include file was not anything
as glamorous as a name conflict. After groping around a bit it
dawned on me that the Jscript parser in Internet Explorer did not
like to see validation code for a textbox that was set to not
visible (and hence not rendered) the first time a particular page
was requested. However, having converted the include file to a
user control and having gotten it to work in the same way that
the include file worked, and comparing the two approaches, I can
not see any benefit to the user control version, and it has the
definite disadvantage of living in three source files rather
than just one, of consisting of something like three times as
much code, and in requiring two lines in the .aspx file in
which it is invoked versus just one with the include file. Note
that this include file did not involve any server-side logic
except for the supplying of two Boolean values to determine whether
particular bits of DHTML should be emitted and three strings
providing messages to be displayed and dismissed by the browser.
(What I am working on has some other blocks of server-side
code that are extensive and that I think will be great candidates
for conversion to user controls, but that is another story.)
So, for this small amount of DHTML stuff that does not involve
any logic, is there some advantage of putting it into a user
control that I have failed to recognize?
Thanks, Lou
-----Original Message-----
From: mvermef@y... [mailto:mvermef@y...]
Sent: Friday, October 19, 2001 3:48 PM
To: ASPX_Professional
Subject: [aspx_professional] RE: Replacing Include Files
Karl,
ssi is still present but it isn't as pronounced as it was in ASP 3.0. If
you must use includes lookup Virtual includes and most of the stuff you
can do with them is better done with User Controls, for importation of
other content.. You can do all of what the previous could and can do an
more with User Controls for the visual and coding aspect. As for your
request about including functions(methods) that you created, just write
up a .vb (VB.NET) or .cs(C#.NET) class file with set of functions
(methods) using the language of your current project. I had the same
question when I started .NET development and now i have created a fully
operational Ecommerce site.
Morgan