Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Professional section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old February 7th, 2012, 02:31 PM
Registered User
Points: 10, Level: 1
Points: 10, Level: 1 Points: 10, Level: 1 Points: 10, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Feb 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default ASP Classic > ASP.net discussion

Hi All

Please don't think I'm a troll and apols for the multi-post as I don't know
at the mo, which is the best NG for this kind of msg.

Believe it or not, I was a day-to-day dev/lover of ASP classic some 5 or so
years ago, but work took me away from the whole web/asp scene. Fate (and my
job) has brought me back and it seems like I've been kept in stasis and the
four horsemen of the ASP apocolypse have been in and ravaged the world of
ASP classic.

ASP code seemed to be everywhere on google, but now everything has been
taken over by .net or something else. Its like somebody has put ASP classic
in a cupboard and we're not allowed to talk about it! The NGs seem to have
taken a battering as well.

I've been a good lad and had a look at ASP.net (honestly I've never even
seen it until this week!) and all I can see is that they've forced us to use
an IDE and dumbed classic down. I know the last statement might seem a bit
strong, but all of this binding of controls, master pages, block login page
modules, etc are all well and good for the new user so that they can
virtually drag and drop a solution into a portion of their web site, but the
reason most of us coded via notepad was so that we had ultimate control over
how things looked and how they worked. Working a the code level enabled us
to make our code text very lean (MS Word HTML what a joke!) and we could use
numerous techonolgies (eg CSS, ASP, DOM, Javascript, ASP, COM, etc) in our
pages without any constraints but our brains. MS don't know how I work so
their 'in a box' modules will no doubt limit me rather than make thnigs
easier. Am I on my own on this??

The master pages thing is a classic as it talks about making common 'chunks'
for your pages, but the implementation (code wise) is way more confusing
than the simple include file method that we all used and we could stick
these includes any where we want and as many as we want.

The only thing that I thought they would do to improve ASP was to provide
more components/objects as part of the codebase like php does, eg ASP
upload, ASP > PDF, ASP > JPG, etc - all built-in rather than us having to
buy (or plead for from our ISP).

Is it actually possible to code ASP.net rather than drag and drop objects
like Visual Studio? I always did my ASP > DB stuff in code as you could do
all of this in very little lines of code and do whatever you want, but there
doesn't seem to be any 'raw coding' books out there. Everything is through
the GUI, but then the forums all post code solutions. Where are people
finding these source code examples??

Sorry for the rant. I'd prefer to stay ASP classic, but it seems like
everybody is putting it in the cupboard and moving on.

Rgds Mojo
Reply With Quote
  #2 (permalink)  
Old February 7th, 2012, 04:20 PM
Imar's Avatar
Wrox Author
Points: 71,164, Level: 100
Points: 71,164, Level: 100 Points: 71,164, Level: 100 Points: 71,164, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 16,960
Thanks: 79
Thanked 1,559 Times in 1,536 Posts
Default

Hi there,

I come from a Classic ASP background and I hear what you're saying. However, ever since I made the switch to .NET about 10 years ago, I never started a new project in Classic ASP anymore (although I have been supporting and updating existing Classic ASP apps).

I think part of your frustration (which is understandable) comes from inexperience with the product and the framework. Use some of the new features, and you'll appreciate how it works. Let me address some of your concerns in the remainder of this post, with an alternate direction you could take at the end. For the record: all of this post deals with ASP.NET Web Forms as that's what you seem to be working with right now. The alternate direction talks about a different ASP.NET solution: ASP.NET MVC.

Quote:
ASP code seemed to be everywhere on google, but now everything has been
taken over by .net or something else. Its like somebody has put ASP classic
in a cupboard and we're not allowed to talk about it! The NGs seem to have
taken a battering as well.
Yes, that's true. I think first of all, more and more people are doing ASP.NET and thus have the need for good NG support. Also, most of the Classic ASP stuff has already been discussed in the past. Since there are no new developments, there's not much new stuff to talk about and discuss. However, you'll find plenty of examples and NGs still. On Google, "classic asp example" returns 2.6 million hits (granted, asp.net example does over 40 million).

Quote:
Working a the code level enabled us to make our code text very lean (MS Word HTML what a joke!) and we could use numerous techonolgies (eg CSS, ASP, DOM, Javascript, ASP, COM, etc) in our pages without any constraints but our brains.
You're certainly not alone. Many others have said the same: limited control over the HTML that is rendered, page bloat, massive ViewState data and more. Most of it is true out of the box, but you also have control over many steps in the process. Use a GridView and turn on ViewState and you could end up with megabytes of ViewState. Use a ListView instead and make some intelligent decisions on how to set up up and approach your data and it can be as clean as Classic ASP with faster performance. So, it all depends. Yes, ASP.NET easily enables you to create a big mess at run-time that's worse than the spaghetti mess that Classic ASP can be at the server. But just as you can write clean, optimized and maintainable sites in Classic ASP, so can you write well behaving and performing ASP.NET web sites.

Quote:
The master pages thing is a classic as it talks about making common 'chunks'
for your pages, but the implementation (code wise) is way more confusing
than the simple include file method that we all used and we could stick
these includes any where we want and as many as we want.
Master Pages (and User Controls for non-structural reusable blocks) are *way* better than includes. They enable a consistent and type safe design. Also, rather than just centralizing look and feel they also enable you to define logic and enable you to program them at run-time. Master Pages are a feature I have been wanting for a long time (they didn't exist in the early versions of ASP.NET) and you'll appreciate them if you better understand how they work.


Quote:
Is it actually possible to code ASP.net rather than drag and drop objects
like Visual Studio?
Absolutely. In Visual Studio 2010 you can opt for a "code only" model to disable all "design time" features. More details can be found here: http://blog.hmobius.com/post/2010/02/11/ASPNET-40-Part-1-New-Visual-Studio-Code-Optimized-Profiles.aspx

This means you'll need to manually hook up events (such as a Button's Click event) in the Code Behind manually but that seems to fit the code model quite nicely. In the next version of Visual Studio, the code only mode is expanded and enables you to bind event handlers from the Code Editor without manually typing all the code needed: http://abhijitjana.net/2011/10/12/fe...et-developers/

Quote:
I always did my ASP > DB stuff in code as you could do
all of this in very little lines of code and do whatever you want, but there
doesn't seem to be any 'raw coding' books out there. Everything is through
the GUI, but then the forums all post code solutions. Where are people
finding these source code examples??
There are dedicated books on ADO.NET (the successor to "classic" ADO) such as this one: http://www.wrox.com/WileyCDA/WroxTit...764584375.html They show you how to do raw coding. In addition, you may find my series on N-Layer design interesting as they cover a lot of hand coding as well:

http://imar.spaanjaars.com/416/build...pnet-20-part-1
http://imar.spaanjaars.com/476/n-lay...l-introduction

However, you may also want to look at the Entity Framework Code First. EF is an ORM that handles a lot of database interaction for you. The "Code First" flavor lets you create your own classes and code which are then handled by the data access framework, giving you great control over the process. This way you can focus on the business requirements more than on boring stuff such as defining parameter sizes, without giving up control.

So, to summarize, yes, ASP.NET Web Forms can be a daunting framework to get started with. It can generate a mess at run-time, and it may make you feel you lose control when working with the visual designers. However, all of this is a choice. You don't have to create a mess when you know what you're doing. You don't have to use the visual designers if you prefer to handcode. And you don't have to use the built-in SqlDataSource if you prefer hand coding (although I would still recommend to use the ObjectDataSource control to target your own code). So, all of this is a choice.

However, as I said earlier, you are certainly not alone. Microsoft has been hearing this for years, ever since they released the first version of ASP.NET back in the days. In response to that, they released ASP.NET MVC (Model View Controller). MVC takes away all these disadvantages, giving you a code only experience, with full control over markup and other run-time behavior. MVC is really popular today as it addresses many of your concerns about AP.NET Web Forms.

If you want to find out more about MVC, take a look here:

http://www.asp.net/mvc

If you want to use Web Forms instead, you can take a look here:

http://www.asp.net/web-forms

Additionally, you may want to take a look at my Beginning ASP.NET 4 in C# and VB book that deals with Web Forms exclusively: http://www.wrox.com/WileyCDA/WroxTit...470502215.html

You may want to read more about the Web Forms versus MVC debate here: https://www.google.com/#sclient=psy-...=1050&bih=1286

The good thing is: these frameworks "learn" from each other, giving you features that previously only existed in the other. As Scott Hanselman put it:

Quote:
One other thing I wanted to say. It's becoming clearer to me that it's less about WebForms or MVC or WCF WebAPI Services or OData or IHttpHandlers or SingalR and more about ASP.NET. I used to call mix-and-match apps "hybrid" applications, but now I'm realizing they are just ASP.NET applications. I'll use whatever LEGO piece(s) I want and you should also.
I think I spend as much time with MVC as I do with Web Forms. And I like both of them.

Quote:
Sorry for the rant. I'd prefer to stay ASP classic, but it seems like
everybody is putting it in the cupboard and moving on.
Sorry for the long reply, but that's what you get when you post a long rant.... ;-)

Hope this clears some of your doubts, but feel free to post follow up questions....

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
Reply With Quote
  #3 (permalink)  
Old February 7th, 2012, 06:36 PM
Friend of Wrox
Points: 6,664, Level: 34
Points: 6,664, Level: 34 Points: 6,664, Level: 34 Points: 6,664, Level: 34
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2004
Location: Sydney, NSW, Australia.
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

Hi Mojo36 - Lucky you, you could not have a more qualified person (Hi Imar) to respond to your post. A very detailed response which im sure a fair number of people will find extremely useful! They should mark this post 'a great read'

I just though I would let you know I am still in 'the cupboard' you talk about having coded Classic ASP for 10+ years. Our office here in Australia are of course supporting existing Classic ASP systems, but continue to build new ones! As i sure you are well aware, classic ASP still works the same even thought its growth from MS has stopped.

About a year (or two...) ago we had a lull and I thought I had better up-skill (primarily because I wanted leverage for a performance/pay review) so I bought Imars ASP.NET 3.5 in C# and VB and went through it front to back. This was an excellent introduction to the .net world. Providing you do all the examples it was a well thought out learning curve. After this I did one 'real job' in ASP.net however purely because of demand I have been back using in the classic world ever since.

Even though the .net world seems to have excellent state management (from my limited experience a significant improvement), scalability, interoperability and a comprehensive set of tools that allow better functionality I can still build a system in around two thirds of the time. EG outgoing proposals in our office are like this. If I quote 60 days to build a system in classic ASP, the same system will be quoted around 80 days in .net - In this situation it will cost the client 80k for the classic build and 105k for the .net build........

Anyhow I have probably said enough, my objective here was to hopefully add some value to this post and to give Mojo36 the news that there are guys still coding in 'the cupboard'
__________________
Wind is your friend
Matt
Reply With Quote
The Following User Says Thank You to mat41 For This Useful Post:
Imar (February 7th, 2012)
Reply


Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
using asp.net code in classic ASP (audit log) rockstar283 Classic ASP Basics 0 November 17th, 2010 03:48 PM
classic ASP to ASP.NET 2.o XML coding rupen XML 10 May 18th, 2010 04:09 AM
classic ASP to ASP.NET 2.o XML coding rupen ASP.NET 2.0 Basics 0 May 14th, 2010 08:25 AM
How to Change ASP.NET into Classic ASP? GailCG Classic ASP Basics 2 April 22nd, 2009 07:04 PM
classic asp with asp.net on same iis bostonrose .NET Framework 2.0 6 January 10th, 2007 12:38 PM



All times are GMT -4. The time now is 04:20 PM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.