...

View Full Version : What's ASP.NET?



Digger3000
07-06-2005, 07:46 PM
I didn't want to make the first thread, but now that someone's made the very useful "eek" thread, I can ask a question. What's the difference between ASP and ASP.NET?

JamieR
07-06-2005, 08:07 PM
I don't know much about it myself, however compared to classic ASP, ASP.Net is part of Microsoft's .Net technology, doesn't use vBscript as it's default language and is apparenly a lot easier to code.

http://www.aspnetfaq.com/default.aspx?CategoryId=49
http://lists.evolt.org/archive/Week-of-Mon-20011001/058396.html
..might help.

Graft-Creative
07-07-2005, 01:06 AM
:eek:

Serex
07-07-2005, 04:15 AM
from what ive heard in encourages lazy coding techniques but is powerfull none the less :)

Digger3000
07-07-2005, 06:22 PM
Cool, I'm all about lazy.

miranda
07-08-2005, 05:29 PM
from what ive heard in encourages lazy coding techniques but is powerfull none the less :)

Hmmm, obviously you have never used it. I would be interested to hear more about how using it encourages lazy coding. IMO using ASP.NET vs using Classic ASP makes the programmer better at coding.

You are right in one thing. ASP.NET is much more powerful than classic ASP.

Classic ASP uses scripting languages on the server side and has support for VBScript and JScript built in, and has extensions to use python and PerlScript. Most people will use VBScript. ASP.NET use the complete version of the language, and supports any.Net compliant language including APL, C++, C#, COBOL, EIFFEL, FORTH, FORTRAN, JAVA, JScript, PASCAL, PERL, PYTHON, RPG, VISUAL BASIC 7. Most people use VB.Net (VB 7) or C#.

In classic ASP using VBScript as the server side language, all variables are of the type variant, and do not have to be declared before use. Leading to lazy programming techniques. In ASP.NET variables must be declared and typed before use.

Code in classic ASP is interpreted by the ISA server. Code in ASP.NET is compiled, therefore runs faster.


Code in classic ASP is quite often intermingled with html on the page. Code has to be placed where you want the output to appear. (If done with sub routines the call to the sub routine is placed where the output is to appear.) ASP.NET code is often in a seperate code behind file, or it is in a script block at the top of the page. If you are working in a team environment the person doing the HTML can make changes to layout etc without effecting the code.

Classic ASP uses COM objects to accomplish things like database connections, uploads, email. These COM .dll's must be registered on the server, the server will need to be stopped and restarted before they can be used. ASP.NET doesn't need COM objects to do any of these.

In classic ASP, display of data from a database generally uses a recordset and a loop to naviagate each row of the database. In ASP.Net database display is done using either the DataGrid, DataList, or Repeater. These are all web controls. Database display never uses a loop.

Debugging in Classic ASP is difficult without Visual Studio. VBScript offers On Error Resume Next, the errors generated are vague at best. VB.Net uses the Try Catch error handling block. Errors produced are not vague and show the code and the line number as well as a detailed description of the error.

Those are some of the differences others may point out more.

Grant Palin
07-08-2005, 08:00 PM
^ Really good comparison, miranda.

Another item I would point out is that Classic ASP makes several server-side objects available to the scripting language involved, including Request, Response, Session, Cookie, and Server. There's one or two others as well, but can't think of them at the moment. ASP.NET, however, has many many more intrinsic objects available to the server-side scripting - can't think any of those at the moment either! But because ASP.NET is part of the .NET framework, it has access to everything that is in the framework...e.g. classes, methods, controls, etc.

bfsog
07-08-2005, 10:47 PM
Nice comments.

I learned classic ASP about 3 years ago, found it v. easy to leanr.
Year ago I started learning .NET (VB & C#) and then started using Web Matrix to create web app's via asp.net and didnt really like it.

JamieR
07-08-2005, 10:55 PM
I don't like ASP, in any form..at all - I stick to learning PHP.

Digger3000
07-08-2005, 11:37 PM
I think ASP is cool, but I like PHP better too.

miranda
07-09-2005, 12:56 AM
I don't like ASP, in any form..at all - I stick to learning PHP.

I personally do work in PHP, ASP Classic, and ASP.Net. I messed with CFM a few years ago too, and decided to leave that alone. I base the decision on which platform to use on my clients needs. You can never know too many programming languages or technologies.

Grant Palin
07-09-2005, 01:03 AM
You can never know too many programming languages or technologies.

Exactly right. I agree. The more you have on your resume, the more attractive you will be to a potential employer. Besides, knowing their similarities and differences will help you to decide which would be best to use in a particular situation.

Personally, I have a lot of experience with Classic ASP and PHP...I hope to spend some time this summer learning the .NET framework and using ASP.NET. I like to learn new things, and it could be useful someday.

A1ien51
07-09-2005, 05:28 AM
The ASP.NET 2.0 framework will blow you away when you get your hands on it. If you are learning the language spend the money and buy the watered down version of Visual Studio.

There is a learning curve at first since it is no scripting language. I say jump on the language if you get the chance.

My 2 cents.
Eric

evilguru
07-10-2005, 11:51 PM
I am no ASP.net expert, and nor do I claim to be, but dont some of the data grid web controls encourage sloppy code? If you take a look at the generated html from one it is often non-w3c valid. Is it possible to make asp.net web controls output valid code?

Digger3000
07-11-2005, 03:06 AM
Well here's a question. Am I going to be able to use ASP without that IIS thing?

Brandoe85
07-11-2005, 03:59 AM
Well, you might want to look into these:
Apache::ASP (http://www.apache-asp.org/)
Suns ASP -- not free though (http://www.sun.com/software/chilisoft/index.xml)
Otherwise yes, you'll need IIS running.

miranda
07-11-2005, 04:46 PM
I am no ASP.net expert, and nor do I claim to be, but dont some of the data grid web controls encourage sloppy code? If you take a look at the generated html from one it is often non-w3c valid. Is it possible to make asp.net web controls output valid code?

Yes, some formatting does have the resultant code be noncompliant. However,the developer doesn't write sloppy HTML. This is the result of being processed by the server. The only way around this is for the user to write their own datagrid control. Perhaps some of the 3rd party datagrid controls output compliant HTML? Anyway here is an example of what a datagrid control looks like at design time.

<asp:DataGrid id="trailersDG" runat="server" OnUpdateCommand="trailersDG_Update" OnCancelCommand="trailersDG_Cancel" OnEditCommand="trailersDG_Edit" OnPageIndexChanged="NewPage" OnDeleteCommand="trailersDG_Delete" OnItemDataBound="trailersDG_ItemDataBound" OnSortCommand="SortEventHandler" AllowCustomPaging="True" AllowPaging="True" PageSize="15" DataKeyField="id" AutoGenerateColumns="False" AllowSorting="True" ShowFooter="True" GridLines="None">
<FooterStyle backcolor="DarkGray"></FooterStyle>
<HeaderStyle font-size="Larger" font-bold="True" backcolor="DarkGray"></HeaderStyle>
<PagerStyle verticalalign="Middle" font-bold="True" horizontalalign="Center" backcolor="White" mode="NumericPages"></PagerStyle>
<AlternatingItemStyle backcolor="#C0C0FF"></AlternatingItemStyle>
<Columns>
<asp:ButtonColumn Text="Delete" ButtonType="PushButton" CommandName="Delete"></asp:ButtonColumn>
<asp:BoundColumn DataField="equipmentCode" SortExpression="equipmentCode" HeaderText="Code">
<HeaderStyle width="150px"></HeaderStyle>
</asp:BoundColumn>
<asp:BoundColumn DataField="equipmentType" SortExpression="equipmentType" HeaderText="Type">
<HeaderStyle width="150px"></HeaderStyle>
</asp:BoundColumn>
<asp:TemplateColumn>
<ItemTemplate>
<asp:Button runat="server" Text="Edit" CommandName="Edit" CausesValidation="false"></asp:Button>
</ItemTemplate>
<FooterTemplate>
<asp:linkbutton runat="server" OnClick="AddNewRow" Text="Add New Row.." Enabled="<%# IsLastPage() %>" />
</FooterTemplate>
<EditItemTemplate>
<asp:Button runat="server" Text="Update" CommandName="Update"></asp:Button>
&nbsp;<asp:Button runat="server" Text="Cancel" CommandName="Cancel" CausesValidation="false"></asp:Button>
</EditItemTemplate>
</asp:TemplateColumn>
<asp:BoundColumn Visible="False" DataField="id"></asp:BoundColumn>
</Columns>
</asp:DataGrid>

And here is the HTML output by that control. HTML in red is noncompliant with W3C standards. Notice that there are exactly two instances of non-compliance as per the W3C validator (http://validator.w3.org/)

<table cellspacing="0" border="0" id="trailersDG" style="border-collapse:collapse;">
<tr style="background-color:DarkGray;font-size:Larger;font-weight:bold;">
<td>&nbsp;</td><td style="width:150px;"><a href="javascript:__doPostBack('trailersDG$_ctl2$_ctl0','')">Code</a></td><td style="width:150px;"><a href="javascript:__doPostBack('trailersDG$_ctl2$_ctl1','')">Type</a></td><td>&nbsp;</td>
</tr><tr>
<td><input type="submit" name="trailersDG:_ctl3:_ctl0" value="Delete" onclick="javascript:return confirm('Are you sure you want to delete Stretch Flat?')" /></td><td>SF</td><td>Stretch Flat</td><td>
<input type="submit" name="trailersDG:_ctl3:_ctl1" value="Edit" />
</td>
</tr><tr style="background-color:#C0C0FF;">
<td><input type="submit" name="trailersDG:_ctl4:_ctl0" value="Delete" onclick="javascript:return confirm('Are you sure you want to delete Reefer?')" /></td><td>RF</td><td>Reefer</td><td>
<input type="submit" name="trailersDG:_ctl4:_ctl1" value="Edit" />
</td>
</tr><tr>
<td><input type="submit" name="trailersDG:_ctl5:_ctl0" value="Delete" onclick="javascript:return confirm('Are you sure you want to delete Low Boy?')" /></td><td>LB</td><td>Low Boy</td><td>
<input type="submit" name="trailersDG:_ctl5:_ctl1" value="Edit" />
</td>
</tr><tr style="background-color:#C0C0FF;">
<td><input type="submit" name="trailersDG:_ctl6:_ctl0" value="Delete" onclick="javascript:return confirm('Are you sure you want to delete Double Drop?')" /></td><td>DD</td><td>Double Drop</td><td>
<input type="submit" name="trailersDG:_ctl6:_ctl1" value="Edit" />
</td>
</tr><tr>
<td><input type="submit" name="trailersDG:_ctl7:_ctl0" value="Delete" onclick="javascript:return confirm('Are you sure you want to delete Removable Goose Neck?')" /></td><td>RGN</td><td>Removable Goose Neck</td><td>
<input type="submit" name="trailersDG:_ctl7:_ctl1" value="Edit" />
</td>
</tr><tr style="background-color:#C0C0FF;">
<td><input type="submit" name="trailersDG:_ctl8:_ctl0" value="Delete" onclick="javascript:return confirm('Are you sure you want to delete Auto Carrier?')" /></td><td>CH</td><td>Auto Carrier</td><td>
<input type="submit" name="trailersDG:_ctl8:_ctl1" value="Edit" />
</td>
</tr><tr>
<td><input type="submit" name="trailersDG:_ctl9:_ctl0" value="Delete" onclick="javascript:return confirm('Are you sure you want to delete Vented Van?')" /></td><td>VV</td><td>Vented Van</td><td>
<input type="submit" name="trailersDG:_ctl9:_ctl1" value="Edit" />
</td>
</tr><tr style="background-color:#C0C0FF;">
<td><input type="submit" name="trailersDG:_ctl10:_ctl0" value="Delete" onclick="javascript:return confirm('Are you sure you want to delete Van?')" /></td><td>V</td><td>Van</td><td>
<input type="submit" name="trailersDG:_ctl10:_ctl1" value="Edit" />
</td>
</tr><tr>
<td><input type="submit" name="trailersDG:_ctl11:_ctl0" value="Delete" onclick="javascript:return confirm('Are you sure you want to delete StepDeck?')" /></td><td>SD</td><td>StepDeck</td><td>
<input type="submit" name="trailersDG:_ctl11:_ctl1" value="Edit" />
</td>
</tr><tr style="background-color:#C0C0FF;">
<td><input type="submit" name="trailersDG:_ctl12:_ctl0" value="Delete" onclick="javascript:return confirm('Are you sure you want to delete FlatBed?')" /></td><td>FB</td><td>FlatBed</td><td>
<input type="submit" name="trailersDG:_ctl12:_ctl1" value="Edit" />
</td>
</tr><tr style="background-color:DarkGray;">
<td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>
<a href="javascript:__doPostBack('trailersDG$_ctl13$_ctl0','')">Add New Row..</a>
</td>
</tr><tr align="Center" valign="Middle" style="background-color:White;font-weight:bold;">
<td colspan="5"><span>1</span></td>
</tr>
</table>

cooleo100d
07-11-2005, 04:55 PM
For all of you who say PHP is better, I probably agree with you. But that is no reason what so ever to not learn ASP or ASP.NET. Let's face it, most large companies use asp.net or asp, so if you ever plan on programming for a large company, you should know ASP or ASP.NET, or both.

JamieR
07-11-2005, 10:11 PM
After all you'll never know too many languages :) - Anyway, I'm a PHP guy really - trying to learn more about it but ASP.Net I suppose gives me a reason to learn it :eek:

Jamie.

Freon22
07-13-2005, 02:02 AM
I don't know php and wont want to learn php. Not trying to make a living by coding, so I get to pick what I want. :) But I just order SQL Server 2000 Developer Edition, am looking forward to moving away from MS access and vbscript to SQL and vb.net

Should be fun and I'm sure I will be asking lot of question here, good to see they opened up this forum.

ghell
07-27-2005, 06:06 PM
imo asp.net is much more powerful than php (i dont really see why ne1 is talkin about php though, its not part of the question is it:rolleyes: )

the fact is you can write real code in asp.net and its much faster, php is messed up perl thats been messed upagain (well thats one way of lookin at it anyway)

every php author i know has switched to asp.net using c# so that must be saying something (and these are all those guys that only used php in the first place because they have an irrational phobia (hate) of microsoft so something pretty important must have turned them eh ;))

Digger3000
07-27-2005, 10:41 PM
Well I can't use asp on my abyss server.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum