PDA

View Full Version : Some thoughts on ASP.net


ashishjn
07-28-2004, 10:59 PM
Hello all,

This is for all the novices out there new to the world of ASP.NET.

ASP.net by Microsoft is also known as ASP+ is not really a upgraded version of ASP. It is a entirely new technology in terms of server side scripting.

ASP.NET delivers amazing performance when used with the .NET framework allowing you to get a drag and drop coding interface resulting in much less coding


What is Server Side Scripting?

Normally, In case of a web page coded in HTML, the request for the page is sent to the server and the HTML file is sent back to the user.

server side scripting allows you to execute some code, some event before the page is sent back to the user so, here when the user requests a ASP page, the request is sent back to the server from the browser, the ASP engine reads the file line by line executing the script written in the file and after reading all the lines and executing the code the ASP file is returned to the user in the form of a HTML page.


What is .Net Framework?

The .NET Framework is a API for building, deploying, and running Web Services and Applications, with support for over 20 different programming languages.



Are there any differences between ASP.NET Vs ASP

Here are a few major differences between the two scripting languages:

The extension for a ASp.net file is '.aspx'.

ASP.net offers full compatibility with languages like Visual Basic, C#, C++ where as ASP does not.

ASP.Net contains a huge set of HTML controls all of which can be defined as ASP.NET control objects which in turn can be controlled by scripts.

There is better event handling, all the objects on a page can be processed by the code written in ASp.net Supports custom forms based user authentication & according to the privileges of the user he has access to information displayed.

At the first request of a ASP.net page the code is compiled and a copy of it created & cached in the memory, thus allowing for increased performance.


Can I install ASP.net?

You will need a windows compatible PC & a windows O/S, windows 2000 or XP are good options.

You will also need the internet information server installed, this comes bundled with the 2000 & XP & some other versions of the Microsoft O/S, you can install it by going to the add/remove programs in your control panel.

A internet connection to download & install the .Net framework from the Microsoft website, this is different from the .Net SDK which is bigger, around 130MBs.

ashishjn
08-02-2004, 08:50 PM
Hello all,


Here is some more information about ASP.Net

Some features of ASP.NET


Crash protection: ASP.NET has been designed to handle your memory leaks efficiently, whenever a memory leak is detected ASP.net creates another copy of itself, all new requests are directed to this new copy, the older copy is deleted along with the memory leak it created when it finishes executing the pending processes.

Memory Leaks - In order for a program to run it needs memory(RAM), after a application is terminated it should normally free up the computer memory it has been using. However it sometimes does not happen which could be due to a bug/design problem in the pplication.


Lets say that out of 4 applications 3 fail to release all or a significant part of the memory that they were using. This memory is now tied up, now if a new application is started it could be possible that the computer does not have enough memory to provide it to run properly, resulting in a huge system slowdown or sometimes crashes.


Caching: ASP.Net allows you to build web applications that are fast, it does that by caching of compiled code, i.e. certain pages can be cached into the memory, so that they don’t take a longer time to retrieve, now the trick here is that this code is compiled, this is it is already converted into a machine readable format.


Caching/Cache MemoryIn a computer almost all of your applications and data are stored on your hard disk, whenever you access something the CPU first searches for it in the cache memory, if the data is there it is returned back the user, otherwise the CPU searches for it in the Hard disk, once the data is found it is first transported to the RAM of your system, and then from to the cache memory and then it is returned to the user.

The memory of the cache depends on the PC configuration, as more and more data is stored in the cache the previous data has to be deleted, caching makes data access faster as if the data is already stored in the cache then it cuts out the step of searching in the memory.

afterburn
08-02-2004, 09:18 PM
are you getting this information out of a book because most of it is mis-leading about ASP.net vs ASP. or just wrong about computers.

1) ASP.net is compiled turns into asmebly directly vs ASP's scripting language which is slower by nature.

2) Memory leaks, now this is the vaguest of all about ASP.net vs ASP. First ASP.net has something called meta data. Where on compile time it creates a hueristic structure of the code. Then GC is implemented in a way that is integrated with the compiler and the runtime, where it knows when an objects scope is past. vs ASP that is implented to know nothing about the implented object that its using to do something. Its a bogus contract that must be bound to IUnknown.

3) Caching, thats completely mis-leading with caching you can cache more than parts of pages or pages. you can cache data,objects also.



4) Caching details, are completely down right wrong. Caching occurs at the OS level not CPU. the CPU could not tell you the time with out the OS, now how do you think that it can actually know the interupt of hardware. A CPU is a mindless peice of hardware. More about caching is that its not completely true that once in memory its cached. COM for instance is removed from memory once the calling program is removed from memory or the object outstanding reference count reaches 0.



5) the file extension is bogus. by default ASP.net uses the extension of .aspx, however it can be changed just like ASP can.


6) the framework, no there is not complete support 20 languages except for those that MS-created (5 languages by MS), more so if it uses the MS framework vs Mono.

the language differences are just blah, thats comparing more grape fruit vs cars.


7) current, most supported, widely excepted version is MS and requires XP pro or greater ... 2k3. But Mono will run on almost any platform, including IA64 and Opteron ( Which isn't even supported by MS in .net 2.0 beta yet).

Besides that fact there is an open source implented ASP.net Hosting webserver that can be downloaded from MS or there is a version of Apache that has some support of it under mono (Not sure of the amount of support).

ashishjn
08-02-2004, 10:35 PM
wow :eek:

Thank you so much for pointing that out. But it is just that I am still learning & understanding things myself, Was just trying to share knowledge with everyone else.

afterburn
08-03-2004, 12:11 PM
I wanted to point out something about "Crash protection" ASP.net is an ISAPI filter. Its unmanaged, so any bug or memory leak there will spill over into the OS. Second off a memory leak is a leak. The issues with leaks is that it compounds with every handle it has. IE a Read a file = A File Handle, A thread = A Thread Handle. Handles are what usually are the cause of memory leaks but many other things can cause them, like allocating memory with the "new" operand, and not calling the "delete" on it. But in the case of Handle you must call the Win32 API CloseHandle, which is a very common mistake as to know when to call it or just not calling it.


The nature of an unmanaged app is that it will have no protection of the JIT or Runtime to protect itself from memory leaks or over runs. So ASP.net filter itself is inheritantly going to incurr human error and leaks.

More so IIS is doing the allocating for ASP.net, as it is calling the filter. Which will expose the issues..... moreover I wanted to explain that IIS is what handles the reallocation of ASP.net, not ASP.net itself. A program can not reallocate itself by launching another copy then terminating the original as the scope would have past and would not know what it was doing. More on the subject is that IIS is the part (IIS 6 that is) bounces the ASP.net threads, and the website Pool thread that its running in, it "pings" the threads if they do not response or IIS sees that its reached the time length, date incerment, or request limits, it will reset the thread pool by default, however you can change the limits or incerments that this occurs at.

Hopefully that is enough information on how IIS works under the hood. Feel free to ask questions about the differences or on either of them on their own.