ASP.NET 2.0 Easier than ASP? Gimmie a Break!

D

dm1608

I know all the hype right now from Microsoft is how much easier, faster, and
less code ASP.NET 2.0 provides over previous versions. I'm puzzled by this
as I could turn out an classic ASP webpage in a few hours to query a
database, display a grid/table, and not have much to worry about. Doing the
same tasks in ASP.NET 2.0 seems almost trivial, but is it really real-world?

I have a classic ASP app that I wrote a few years back that took me probably
6-8 hours to write, debug, and deploy. I haven't really touched it since.
It has simply an input form that will post back to itself and display a
grid/table with the results from a query.

Since I'm trying to get on the ASP.NET 2.0 bandwagon, I thought that simple
ASP application would be a perfect "starter" application for my ASP.NET 2.0
journey. Sure, I drag and drop a table onto the design service, wire up a
GridView to a SQLDataSource and junk, but the real challenge is implementing
these drag-and-drop objects in a real world scenario.

I've been spent approx. 40+ hours on converting this ASP webpage (a single
page, mind you) to ASP.NET 2.0. I'm trying to do an n-tier design and have
a DAL, BAL, along with the ASP.NET 2.0 front-end. I haven't even gotten to
designing a nice "Master" page for site's theme yet.

The concepts seem simple... and some of the results seem pretty impressive.

My current struggle is dealing with nullable datatypes coming back from SQL
Server for a datetime field. Some of you may have read my previous thread
where I am struggling in getting a NULL DateTime field to add to my generic
collection. I keep getting InvalidCastExceptions. I'm about 90% done with
my code, but this one issue is driving me nuts... I've literally spent 10+
hours on this one issue and still do not have it resolved.

I've seen a few online examples writing an n-tier design for ASP.NET 2.0 but
most just deal with strings and not mixed data types. I've watched about 10
different webcasts the latest tricks and ways of doing things... even Fritz
Onion's Essential ASP.NET 2.0 webcast series.... I've purchased all the
latest Microsoft .NET 2005 books. Not much in there about BAL/DAL best
practices.

Six months from now, this may seem like a trivial challenge, but for a
newbie learning ASP.NET 2.0, I'm having a hard time justifying the savings
with going to the new technology. Yeah, my code is more object oriented...
my code and visual content is separate... and I've totally abstracted my
business data from my data access. Very cool. But what is the cost of all
these "advantages"? I still do not have a working application and Microsoft
taughts ASP.NET is far superior and easier than ASP.

I"ve run into other issues along the way and thanks to the kind folks in
these newsgroups, I've resolved them. I'm not master programmer, mind you,
and simply do this for fun and as a hobby... although I do write some web
applications to solve problems at work... it is not my primary function.

I'm curious to know how others feel about the new programming environment
and how they're adapting to the new technologies and programming
requirements.

Does ASP.NET 2.0 really make your life easier than classic ASP or using some
other server-side scripting technology such as PHP or Cold Fusion?
 
E

Edwin Knoppert

I have a classic ASP app that I wrote a few years back that took me
6-8 hours to write, debug, and deploy. I haven't really touched it since.
It has simply an input form that will post back to itself and display a
grid/table with the results from a query.

I love asp.net, the possibilities compared to imo flawed asp is much
greater.

Your 6-8 hours app, i can do that within ~30 minutes with an sqldatasource,
gridview and manually modifying the predefined update SQL statements.
I'll have paging, sorting , editting and updating.
The point is that it took me ages to learn this, after all, trivial stuff.
So i can say it's probably a misconception to say ASP.NET is equal or worse.
The learning curve is pretty steep for the do's and the dont's.
But at the end so much better ...

GREAT MULTIPOST... AGAIN!!
 
D

dm1608

Yes, I can drop-and-drop the GridView and SQLDataSource and probably
duplicate much of the same functionality in the ASP. But again, I'm trying
to do this with best practices in mind and use ObjectDataSource instead...
which makes developmenting the page a lot more complicated and time
consuming with creating the BAL and DAL access.
 
D

darrel

The learning curve is pretty steep for the do's and the dont's.
But at the end so much better ...

That's how I'd put it.

ASP.net is really great ONCE you 'get' it. And that takes a long while. I'm
still trying to 'get' it fully.

As such, I think ASP.net is great for a lot of stuff, and overkill for a lot
of stuff, too.

-Darrel
 
G

Guest

dm1608 said:
I know all the hype right now from Microsoft is how much easier, faster, and
less code ASP.NET 2.0 provides over previous versions. I'm puzzled by this
as I could turn out an classic ASP webpage in a few hours to query a
database, display a grid/table, and not have much to worry about. Doing the
same tasks in ASP.NET 2.0 seems almost trivial, but is it really real-world?

Part of your speed with ASP is your familiarity with it. There is certainly
a learning curve to .NET. The problem with ASP, overall, is most of the ASP
code sucks. This is due to the plethora of people who have gotten into ASP
who have no clue when it comes to proper coding practices. I am not accusing
all ASP devs, of course, but there is lots of really bad ASP code.

Now, one can certainly write CRAP in ASP.NET, as well. It is a bit harder as
you have to write classes, but ASP.NET is no panacea (silver bullet for the
rest of you guys ;->).

Some of the "ease of use" stuff in ASP.NET is not very real world, at least
not on an Enterprise scale. But, you will quickly learn which things are good
for larger apps and which are not as you get into it. Many of the drag and
drop features are great for small apps and prototypes, but really suck in the
Enterprise.

But, this is not all productivity is about. Many of the aids are in the
Intellisense, refactoring tools, ability to write generic code, etc.
I have a classic ASP app that I wrote a few years back that took me probably
6-8 hours to write, debug, and deploy. I haven't really touched it since.
It has simply an input form that will post back to itself and display a
grid/table with the results from a query.

Since I'm trying to get on the ASP.NET 2.0 bandwagon, I thought that simple
ASP application would be a perfect "starter" application for my ASP.NET 2.0
journey. Sure, I drag and drop a table onto the design service, wire up a
GridView to a SQLDataSource and junk, but the real challenge is implementing
these drag-and-drop objects in a real world scenario.

If your app does not get hammered much, the drag and drop will work great,
even without any tiers. Moving to BAL, DAL, etc., is a good learning
exercise, but not a necessity.
I've been spent approx. 40+ hours on converting this ASP webpage (a single
page, mind you) to ASP.NET 2.0. I'm trying to do an n-tier design and have
a DAL, BAL, along with the ASP.NET 2.0 front-end. I haven't even gotten to
designing a nice "Master" page for site's theme yet.

Is your ASP application properly tiered? Probably not, which explains 6-8
hours versus 40+ hours. It is a learning excercise both in ASP.NET 2.0 and
proper tiered development.

Give me the same app and I could make all three of the tiers for a simple
form in about 15 minutes for a simple form. It is all about familiarity, of
course.
The concepts seem simple... and some of the results seem pretty impressive.

My current struggle is dealing with nullable datatypes coming back from SQL
Server for a datetime field. Some of you may have read my previous thread
where I am struggling in getting a NULL DateTime field to add to my generic
collection. I keep getting InvalidCastExceptions. I'm about 90% done with
my code, but this one issue is driving me nuts... I've literally spent 10+
hours on this one issue and still do not have it resolved.

If you stick in the SQL Types, you have the ability to capture nulls. If you
are using DataSets, you can do an IsFieldNameNull() check before using the
value. It adds a safety valve when going from nullable (SqlTypes) to
non-nullable (.NET Framework base types).
I've seen a few online examples writing an n-tier design for ASP.NET 2.0 but
most just deal with strings and not mixed data types. I've watched about 10
different webcasts the latest tricks and ways of doing things... even Fritz
Onion's Essential ASP.NET 2.0 webcast series.... I've purchased all the
latest Microsoft .NET 2005 books. Not much in there about BAL/DAL best
practices.

The Patterns and Practices sites on MSDN is one of the best. There are also
some reference architecture projects on gotdotnet.com that can help put best
practices into place. Watch out, however, as some are overkill for a simple
form project.
Six months from now, this may seem like a trivial challenge, but for a
newbie learning ASP.NET 2.0, I'm having a hard time justifying the savings
with going to the new technology. Yeah, my code is more object oriented...
my code and visual content is separate... and I've totally abstracted my
business data from my data access. Very cool. But what is the cost of all
these "advantages"? I still do not have a working application and Microsoft
taughts ASP.NET is far superior and easier than ASP.

For an extremely small app, there is nothing wrong with putting everything
in the ASP.NET app and being done with it. I would learn BAL, DAL, etc. for
larger (Enterprise oriented) apps, where they make sense.
I"ve run into other issues along the way and thanks to the kind folks in
these newsgroups, I've resolved them. I'm not master programmer, mind you,
and simply do this for fun and as a hobby... although I do write some web
applications to solve problems at work... it is not my primary function.

I would stick to simple drag and drop and not best practices until you are
familiar, esp. if they are small apps. You will get many of the ASP.NET
benies without the pain.
I'm curious to know how others feel about the new programming environment
and how they're adapting to the new technologies and programming
requirements.

As an Enterprise Architect, the .NET technologies finally make Microsoft a
really viable option. The 2.0 Framework expands the paradigm and the Visual
Studio 2005 family speed up my dev time. Add on Team System and I am really
jazzed about this. It is overkill for mom and pop organizations who make
small websites.
Does ASP.NET 2.0 really make your life easier than classic ASP or using some
other server-side scripting technology such as PHP or Cold Fusion?

Yes! But, once again, with the caveat that you pick the correct tool(s) for
the job. You can move to ASP.NET without eating the entire meal.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
 
M

Merennulli

It's not neccessarily about an improvement for the proficient.
Microsoft has always been a huge proponent of letting the non-geek play
in the geeks world (much to the chagrin of the average geek). These
drag and drop options, even to me with my background in Perl , PL/SQL,
and even Fortran, I find convenience in that I don't have to keep up
with everything MS decides is "a nice feature" at the moment. I know
what a button is. In my code, it steams me to see <asp:button> in place
of HTML, and it does get to me when I'm writing CSS and Javascript to
work with these objects, but I can quickly get all the "ugly" ASP.net
objects and get to the meat of the code much more rapidly than I can
with my beloved Perl code.

I will admit, though. It did double my development time when I stopped
using "aspcompat=true", BUT, it cut my debug time in half, and for me,
debug is the majority of any project.

That said, if they really want to improve things, they should scrap
that abhorred thing they call "gridlayout". I've inherited a lot of
hobbled pages thanks to a former VB programmer who insisted on using
that.
 
R

Rune B

I'm curious to know how others feel about the new programming environment
and how they're adapting to the new technologies and programming
requirements.

Does ASP.NET 2.0 really make your life easier than classic ASP or using
some other server-side scripting technology such as PHP or Cold Fusion?

In the beginning I generally used the double-3 times the amount of time,
achieving the same result as with classic ASP.
- Today, the same stuff is achieved much faster than ever before.. but often
I find myself refining businesslogic, building pluggable providers for this
and that - stuff that encapsulates and enproves the application, but maybe
isn't nessesary.

It really takes some getting used-to, mainly because of the object-oriented
/ Event-driven fashion everything is made in in .NET
- so different from the everyday VBScript-meat-and-potato coding.

I really felt I had to learn the real OO programming, and today I'm very
glad I did - it has enlightened my universe (and still do).

R-)
 
E

Erik Funkenbusch

Does ASP.NET 2.0 really make your life easier than classic ASP or using some
other server-side scripting technology such as PHP or Cold Fusion?

What you're runningn into is the learning curve of a new framework. And
yes, that's significant compared to classic ASP.

However, the net gain you will get from ASP.NET will be in more complex
applications. Sure, you can pound out a classic ASP app in a few hours,
but will it be scalable? Maintainable? Reusable?

ASP.NET really gives you advantages in that it provides a structure for
your web apps. It provides events that get called at varioius places, and
it gives you a real programming language, compared to a scripting language.
It also gives you compiled code versus interpreted code.

None of this may matter to you, and if that's the case, the maybe it's not
worth it to learn ASP.NET, but this *IS* technology, and if you don't
adapt, you get left behind.
 
S

sloan

In some ways, .net 2005 is a step backwards in my opinion.

well, it depends who you are. for people who want RAPID (key word RAPID)
development, the grids bound to a sql data source...is nice to them.

i'm not in that camp.

There is so much info out now, that its hard to find a good example.

Here is one:
http://gridviewguy.com/ArticleDetails.aspx?articleID=139

But even in this sample, the guy mixes BLL and DLL into one class.
But its a stepping stone, and one issue I see is people take 1 example (like
above) and then "make it THE WAY".
You gotta take the parts from samples that are good... and rework the bad
parts.

This sample above...is a starting point, not an end point.
He doesn't include the sql script for the table ...and it doesnt work if you
don't have 1 User in the db to start with.
These aren't turn key solutions, they are proof of concepts.
Its up to the end developer to put all the pebbles together..to make a
something out of it.


I am currently using a CustomCollection .. and in another place a strongly
typed dataset bound to a
ObjectDataSource control.

I am having good success.

The DateTime thing is tricky, because of the DBNULL.
I usually do something like this

Emp user = new Emp();

if (!idr.IsDBNull(10))//idr is a IDataReader, fyi
{
user.DateOfBirth = idr.GetDateTime(10));
}
else
{
user.DateOfBirth = DateTime.Min;
}


(or .. in the Emp class, I default the DOB to DateTime.Min on construction)

I don't like that ... as much as "null", but its my work around.

Unforunately, I do (when displaying) have to check the value...and clear it
out..if its a DateTime.Min.


While there are some issues, I'd never go back to ASP.
The strong typing, the debugging, the need to not have to "response.write
"myvar = " & myvar
....asp.net is so much better in my opinion.


159059522X (isbn) is a good book .. fyi... for getting to design
decisions..and away from stuff like
"you can create a pretty textbox skin by doing this". i have one of those
books also, but the book I mention is at a higher level.

Good luck.
Yeah, there is a learning curve. But once it starts clicking, it reallly
takes off.
 
B

blackstaronline.net

:) I hear ya. I was a ASP freak for many years. Then finally taking a
break and trying to learn .NET was a challenge. I found my first couple
sites taking me 3 times as long to accomplish the same result but
slowly I started to see what everyone was talking about.

Now between my .NET experience and Google Groups I can pretty much
achieve anything I want to do in .NET as fast if not faster then
before.

Hang in there, one thing follows the other and you'll see why .NET is
far superior.

Jeremy Reid
http://hgtit.com
 
J

Jon Paal

yup, .net is at least ten times harder to learn, and but you can't learn it all, and everything takes 10 times as long to build.
 
K

Kevin Spencer

The difference between ASP.Net and ASP which makes the biggest difference in
terms of productivity is not the IDE, the drag 'n Drop capabilities, or any
of that stuff that beginners think it is. The biggest difference in terms of
productivity is simply this: ASP.Net is object-oriented.

OOP was created as an answer to the increasing complexity of software. In
actuality there is no difference between what an OOP program does; but there
is a big difference in terms of how it does it.

When OOP is fully-utilized, one spends a lot more time up front
architecting, designing, planning, and creating extensible, reusable
classes. It is in the long run that OOP becomes much easier and faster than
Procedural programming, if one knows how to use it correctly.

Take the ASP.Net Controls that ship with the .Net platform 2.0. Many people
think that these *are* the tools you use to build your ASP.Net applications.
Not so. They can be used in part as tools for an ASP.Net application, but
more importantly, one has the ability to create custom controls that either
host these controls, or perform whatever sort of custom operations are
necessary. When designing an app, one must identify the logical components
of that app which should be business classes and UI classes. The more one
thinks ahead, the easier it gets in the long run.

For example, I have been writing ASP.Net apps for at least 3 years. I now
have my own personal set of a dozen or so class libraries which perform
different operations and functions, and often re-use them in different apps.
This is much harder to do with a procedural programming paradigm, and even
more difficult when talking about a scripted technology such as Classic ASP.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
To a tea you esteem
a hurting back as a wallet.
 
D

dm1608

Don't get my wrong.

I love ASP.NET. And yes, there is a huge learning curve and I'm sure once I
get the hang of it, things that are taking me hours now will take me minutes
later...

I'm just surprised how how simple many of the examples that Microsoft
provides on MSDN and their webcasts that just don't provide real world
examples of doing something. My recent post regarding my issue with using
ObjectDataSource and having a DBNull value returned from a SmallDateTime
field within my SQL was causing me "InvalidCastExceptions" within my BAL and
took me hours to figure this out -- luckily the kind folks in this group
showed me how to get around this. Isn't this a common scenario for most
database applications? I can see where there are often perfectly valid
reasons to have a NULL in a SmallDateTime field. It would seem that there
should be more examples demonstrating how to workaround these sorts of
issues.
 
K

Kevin Spencer

I'm just surprised how how simple many of the examples that Microsoft
provides on MSDN and their webcasts that just don't provide real world
examples of doing something.

I can certainly understand your frustration. I spend an hour or more a day
researching various problems, but I have come to the conclusion that this is
simply due to the scope and complexity of the CLR. There have been many
times when I wished that the MSDN Library had more information, but I have a
copy of the MSDN Library on my machine here at work and at home, and it's
simply huge. One cannot expect a resource of that scope to have a lot of
detail about much of anything.

I do believe though, that the various newsgroups (such as this one) and the
various support web sites run both by Microsoft and by individuals, are the
greater part of the solution. The Microsoft newsgroups in particular are a
tremendous resource, where people can ask specific questions and get
specific answers. And my Favorites folder is packed with web references.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
To a tea you esteem
a hurting back as a wallet.
 

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

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,810
Latest member
Kassie0918

Latest Threads

Top