EE Portal

ASP.NET Project

<!DOCTYPE Final Report>

<head>

<Lab Chief Engineer Ilana David>

<Supervisor Viktor Kulikov >

</head>

<body>

<Students= "Liana Lipstov & Pavel Bilenko">

</body>

<LI> Software Systems Lab

<LI> Department of Electrical Engineering

<LI> Technion-Israel Institute of Technology

Contents

  1. Chapter 1
  2. Introduction
  3. Project goals
  1. Chapter 2 :Background
  2. Technology
  3. .NET Framework
  4. Ajax
  5. SQL Server 2008
  6. Visual Web Developer 2008
  1. Chapter 3 :Description
  2. Old portal analyze
  3. New portal design
  4. Design+ effects+ functionality
  5. Security
  1. Chapter 4 : Architecture
  2. Data table relations
  3. Data Access Layer
  4. Ajax Control Toolkit controls
  1. Chapter 5
  2. Project contribution
  3. Thanks and gratitude
  4. References
  1. Chapter 1

<1.a Introduction>

Once upon a time there was an old EE portal. It had poor design, bugs, was based on old .NET framework and couldn’t be open in Visual Studio 2005 or later for debugging or further development. It was written and re-written by different people which caused a great deal of a mess. The code was hard to read and understand, there was pieces of not relevant code that was left there historically from times it have been used for debugging. Not only that, it had an "old" appearance.

Then 2 brave students decided to change the situation, make some magic and rewrite the portal, the rest is a history…

Now seriously, among other things when we have re-written the portal we had mostly written new pages, here and there using existing stored procedures. We have made a great deal of transformation and eventually created a better looking and working portal. We have added visual effects, fading in/out windows, dynamic content, expanding space for data etc. making it more friendly and exciting to the user.

Some new functionality was added to the portal making it more advanced and comfortable:

  • Remember me
  • Messages
  • Additional Info button
  • Custom view (show active modules first)

Among other things we have added feedback messages for user actions, improved security, required fields and more.

</1.a Introduction>

<1.b Project Goals>

The goals of our projects were based on 2 requirements, whereas each one had to be fulfilled:

The first one was a portal from the programmer's side: educational with impact on simplicity in maintenance.

So our goals were:

  • Learn SQL
  • Learn working with DB (SQL Server)
  • Learn ASP.NET
  • Re-write the portal using ASP.NET
  • Write in OOP, make an understandable code.
  • Solve the bugs and improve the flow of the code
  • Security

The second one was from the user's side: friendly and exciting to use. This made us think of the user and how he would like to see it, making it as easy for use as possible.

We have decided to add the following:

  • Improve some of the design (make it more modern)
  • Fading in/out windows
  • Dynamic content
  • Expanding space for data
  • Messages between users
  • Feedback for user's action
  • Visual effects

</1.b Project Goals>

  1. Chapter 2

<2.a Technology>

Following a short summery of the basic development tools and technologies we have used. In the following sub chapters we'll have a better look on them.

What is ASP? ASP stands for: Active Server Pages.

ASP is an easy way to add dynamic content to ordinary web pages and allows you easily create full-scale web applications.

What is .NET framework? .NET Framework is really a cluster of several technologies:

  • CLR (Common Language Runtime): engine that executes all .NET programs and provides automatic services for these applications (memory management, optimization e.t.c).
  • .NET Framework class library: collects thousands of pieces of pre-built functionality that can be “snapped in” to applications.

What is ASP.NET? ASP.NET is an engine that hosts web applications and web services, with almost any feature from the .NET class library. ASP.NET gives you tools to use a higher-level model of server-side web controls. These are created and configured as objects and automatically provide their own HTML output.

Server side programming as an opposite to client side programming: All ASP.NET code executes on the server, the user receives an ordinary HTML page, which can be viewed in any browser. It also allows the web application to be used on any computer that has Internet access. Therefore the server-side programming solves the unwanted problems of client-side programming that are:

  • Isolation: Client-side code can’t access server-side resources.

– For example, a client-side application has no easy way to read a file or interact with a database on the server

  • Security: End users can view client-side code. And once malicious users understand how an application works, they can often tamper with it.
  • Usability: Client- side technologies aren’t supported equally by all browsers and operating systems.

ASP.NET allows web controls to behave like their Windows counterparts by maintaining state and even raising events that can be reacted to in code.

What is Ajax? Ajax is a recent technology which allows posting back page asynchronously and performing partial page refresh.

What is Ajax Control Toolkit? Ajax Control Toolkit –is a Microsoft library of useful controls based on AJAX technology to create more interactive controls (such as animation, password strength e.t.c), this controls provides extensions to existing controls adding new functionality and dynamic behavior

Developing environment-our developing environment was Visual Web Developer 2008 and SQL Server 2008.

</2.a Technology>

<2.b .NET Framework>

Microsoft has a time-honored reputation for creating innovative technologies and wrapping them in buzzwords that confuse everyone. Now that developers are finally sorting out ActiveX, COM (Component Object Model), and Windows DNA (Distributed interNet Architecture), Microsoft has a whole new technology called .NET.

Let's have a quick look at the history of web development and learn why the .NET Framework was created.

The Evolution of Web Development

The Internet began in the late 1960s as an experiment. Its goal was to create a truly resilient information network—one that could withstand the loss of several computers without preventing the others from communicating. Driven by potential disaster scenarios (such as nuclear attack), the U.S. Department of Defense provided the initial funding. The early Internet was mostly limited to educational institutions and defense contractors. It flourished as a tool for academic collaboration, allowing researchers across the globe to share information. In the early 1990s, modems were created that could work over existing phone lines, and the Internet began to open up to commercial users. In 1993, the first HTML browser was created, and the Internet revolution began.

HTML and HTML Forms

It would be difficult to describe early websites as web applications. Instead, the first generation of websites often looked more like brochures, consisting mostly of fixed HTML pages that needed to be updated by hand.

A basic HTML page is a little like a word-processing document—it contains formatted content that can be displayed on your computer, but it doesn’t actually do anything. The following example shows HTML at its simplest, with a document that contains a heading and single line of text:

<html>

<head>

<title> Sample Web Page</title>

</head>

<body>

<h1>Sample Web Page Heading</h1>

<p> This is a sample web page.</p>

</body>

</html>

This will produce the following HTML page in a browser:

HTML 2.0

HTML 2.0 introduced the first seed of web programming with a technology called HTML forms. HTML forms expand HTML so that it includes not only formatting tags but also tags for graphical widgets, or controls. These controls include common ingredients such as drop-down lists, text boxes, and buttons. Here’s a sample web page created with HTML form controls:

<html>

<body>

<form>

<input type="checkbox"> This is choice 1 <br>

<input type="checkbox"> This is choice 2 <br<br>

<input type="submit" value="submit">

</form>

</body>

</html>

The result in a browser:

HTML forms allow web application developers to design standard input pages. When the user clicks the Submit button in the window all the data in the input controls (in this case, the two check boxes) is patched together into one long string and sent to the web server. On the server side, a custom application receives and processes the data. Amazingly, the controls that were created for HTML forms more than ten years ago are still the basic foundation that used to build dynamic ASP.NET pages. The difference is the type of application that runs on the server side. In the past, when the user clicked a button on a form page, the information might have been e-mailed to a set account or sent to an application on the server that used the challenging CGI (Common Gateway Interface) standard. Today, we work with the much more capable ASP.NET platform.

Server-Side Programming

To understand why ASP.NET was created, it helps to understand the problems of other web development technologies. With the original CGI standard, the web server must launch a completely separate instance of the application for each web request. If the website is popular, the web server must struggle under the weight of hundreds of separate copies of the application, eventually becoming a victim of its own success.

To counter this problem, Microsoft developed ISAPI (Internet Server Application Programming Interface), a higher-level programming model. Microsoft used it to build higher-level development platforms, such as ASP and ASP.NET. Both of these technologies allow developers to program dynamic web pages without worrying about the low-level implementation details.

Client-Side Programming

At the same time a new type of programming was gaining popularity. Enhancing web pages by embedding multimedia and miniature applets built with JavaScript, DHTML (Dynamic HTML), and Java code. These client-side technologies don’t involve any server processing. Instead the complete application is downloaded to the client browser, which executes it locally. The greatest problem with client-side technologies is that they aren’t supported equally by all browsers and operating systems. For that reason, ASP.NET is designed as a server-side technology. All ASP.NET code executes on the server. When the code is finished executing, the user receives an ordinary HTML page, which can be viewed in any browser.

The .NET Framework

.NET Framework is really a cluster of several technologies:

  • The .NET languages: These include C# and VB .NET
  • The CLR (Common Language Runtime): The CLR is the engine that executes all .NET programs and provides automatic services for these applications, such as security checking, memory management, and optimization.
  • The .NET Framework class library: The class library collects thousands of pieces of prebuilt functionality that you can insert into your applications
  • ASP.NET: This is the engine that hosts web applications and web services, with almost any feature from the .NET class library. ASP.NET also includes a set of web-specific services.
  • Visual Studio: Development tool that contains a rich set of productivity and debugging features.

The IL

The IL=MSIL(Microsoft Intermediate Language) is a lower -level language. All the .NET languages are compiled into IL before the code is executed. The CLR runs only IL code, which means it has no idea which .NET language you originally used. This is the reason that the C# and VB .NET languages provide essentially the same features and performance.

The following flow chart shows how the .NET languages are compiled to IL. Every EXE or DLL file that is build with a .NET language contains IL code. This is the file tat deployed to other computers:

</2.b .NET Framework>

<2.c AJAX >

AJAX

AJAX – stands for JavaScript and XML. It is a group of interrelated web development techniques used on the client-side to create interactive web applications or rich Internet applications. With Ajax, web applications can retrieve data from the server asynchronously in the background without interfering with the display and behavior of the existing page. Using Ajax helps to increase in interactive or dynamic interfaces on web pages and better quality of Web services due to the asynchronous mode. Data is usually retrieved using the XMLHttpRequest (DOM API that can be used inside a web browser scripting language, such as JavaScript, to send an HTTP or an HTTPS request directly to a web server and load the server response data directly back into the scripting language) object.

AJAX Control Toolkit

AJAX Control Toolkit- open-source project built on top of the Microsoft ASP.NET AJAX framework. It provides infrastructure to write reusable, customizable and extensible ASP.NET AJAX extenders and controls, as well as a rich array of controls that can be used out of the box to create an interactive Web experience.

Why AJAX?

  • In many cases, related pages on a website consist of much content that is common between them. Using traditional methods, that content would have to be reloaded on every request. However, using Ajax, a web application can request only the content that needs to be updated, thus drastically reducing bandwidth usage and load time.
  • The use of asynchronous requests allows the client's Web browser UI to be more interactive and to respond quickly to inputs, and sections of pages can also be reloaded individually. Users may perceive the application to be faster or more responsive, even if the application has not changed on the server side.
  • The use of Ajax can reduce connections to the server, since scripts and style sheets only have to be requested once.
  • State can be maintained throughout a Web site. JavaScript variables will persist because the main container page need not be reloaded.

The dark side of AJAX:

  • The main problem we've met was when we've used the Ajax control toolkit. It's supposed to me nice and comportable, easy working, looking great tool, and it is, until you need somethime slight change in it. Then a huge bugs appear, everyhting stops working, or working not the way it's supposes. Not only that, fixing those bugs takes a great amount of time! The solutions often found in a distinct desparate steps, with changing the code in the most unexpected places. Moving to .NET 3.5 SP1 fixed many bugs and “unsupported” parameters combinations.
  • The ease of use of Ajax-powered interfaces often dramatically increases the number of user-generated requests to web servers and their back-ends (databases, or other). This can lead to slower response times and additional hardware needs to support Ajax-powered interfaces.
  • Pages dynamically created using successive Ajax requests do not automatically register themselves with the browser's history engine, so clicking the browser's "back" button may not return the user to an earlier state of the Ajax-enabled page, but may instead return them to the last full page visited before it.
  • Any user whose browser does not support Ajax or JavaScript, or simply has JavaScript disabled, will not be able to use its functionality. The only way to let the user carry out functionality is to fall back to non-JavaScript methods. This can be achieved by making sure links and forms can be resolved properly and rely not solely on Ajax.

</2.c AJAX >

<2.d SQL Server 2008>

Working with Data

Almost every piece of software ever written works with data .Typical Internet application is just a thin user interface shell on top of a sophisticated database program that reads and writes information from a database on the web server. The user might not even be aware that the displayed information originates from a database.

In our project we not only allow the user to perform simple searches and display results in a formatted table but also to retrieve information, which is processed and displayed in the appropriate format and location in the browser. Using a database is an excellent way to start dividing the user interface logic from the content, which allowed us to create a site that can work with dynamic, easily updated data.

DB (Data Base)

The most common way to manage data is by using a database. Database technology is particularly useful for software in large organizations, such as our faculty, which typically requires hierarchical sets of related information. In our case, a database consists of a list of people (authorized users- faculty workers), a list of permissions for those people, and other information from the other tables. This type of information is best described using a relational model, which is the philosophy that underlies all modern database products, including SQL Server. In chapter 3 shown the table relationships of EE portal