That s Not ASP

IOTA^_^    

Sams Teach Yourself ASP.NET in 21 Days, Second Edition
By Chris Payne
Table of Contents
Day 13.  Reading and Writing Files on the Web Server


That's Not ASP!

File I/O with traditional ASP was accomplished via the FileSystem object. This object provided a lot of the same functionality I described today. ASP.NET comes with access to all the .NET Framework classes, which means that unlike traditional ASP, ASP.NET can perform the same file I/O operations as any standalone application.

Luckily, many of the concepts and even syntax are the same in ASP.NET as they were in traditional ASP. A few of the object names have changed, and some of the behind-the-scenes functionality is different, but developers familiar with the FileSystemObject shouldn't have many problems moving to the new paradigm.

Among the most significant changes is the move to a completely object-oriented design. Each file and directory can be represented with an object in the .NET Framework, and each of these objects provides its own methods, properties, and collections of additional objects. It might take some time to get used to using these tightly related objects as opposed to the loosely structured menagerie that was the FileSystemObject.

Including files is also a bit different in ASP.NET. Because of the way ASP.NET interacts with the .NET Framework, it is essential to include information from other files in your applications. The traditional method of server-side includes is still provided, but there are now many other ways to include files to extend your ASP.NET pages.

Finally, isolated storage is a completely new mechanism for data storage and file access. It eliminates many of the problems that developers faced when building customized user storage solutions. Traditional ASP provided no built-in methods other than those with cookies or databases to maintain persistent data for individual users. Why not still use cookies? You can store a lot more information with isolated storage than with cookies, which allows for much greater customization of your Web sites. Also, isolated storage is easier to deploy, can reside on either server or client, and provides much stronger security measures.

The argument for using isolated storage versus databases is a bit more indistinct. The mechanism you use will often depend on the situation and server configurations. Nevertheless, both methods are useful mechanisms for persistent data storage.


    IOTA^_^    
    Top


    Sams Teach Yourself ASP. NET in 21 Days
    Sams Teach Yourself ASP.NET in 21 Days (2nd Edition)
    ISBN: 0672324458
    EAN: 2147483647
    Year: 2003
    Pages: 307
    Authors: Chris Payne

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net