MASTER THESIS

 

Submitted to: Prof. Ausif Mahmood,

Professor, Department of Computer Science & Engineering

 University of Bridgeport.

 

 

MXC DESIGN WEBSITE – Spring 2006

 

WWW.MXCDESIGN.COM

 

 

 

SUBMITTED BY: YASHESH B. RAJYAGURU

ID: 0678331

MASTER OF SCIENCE, COMPUTER SCIENCE

UNIVERSITY OF BRIDGEPORT

 

 

 

 

 

 

 

 

 

 

 

 

Abstract

 

 

MXC Design is based in the Hollywood Hills, California and Seattle, Washington. The design focuses on a "warm modernism"- a fusion of clean lines and Asian influences with natural materials, finely detailed and crafted.

 

The goal of MXC Design  web site development project is to introduce and explore Mathew’s high talented skills and profession to the world.

The project is developed on .NET technologies using ASP.NET, C#.NET, ADO.NET and the data tables are created and stored into sql server 2000. I was involved in the entire development life cycle of this project.

 

I have designed the Web Pages for MXC Design websites using Macromedia technologies like dreamweaver.Displayed the Portfolio gallery using datalist in ASP.NET.Displayed the thumbnails of the particular selected category.Enlarged the thumbnail into a new page with its description and quote number.Created a virtual tour file for the interiors.Architecture of data tables into SQL  server 2000.

 

I have tried to implement maximum .NET and Object oriented features in my code and design of website. The implementation and staging of the website is done on Synergy Corporate technology, Westport, CT domain.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

CONTENT

 

Chapter 1. Introduction to MXC Design Website                                                 1

 

Chapter 2. Introduction to .NET                                                                          4

 

Chapter 3. Design                                                                                                24

 

Chapter 4. Code description                                                                                26

 

Chapter 5. Screen shots                                                                                       42

 

Chapter 6.  Stagging on Development and Live server.                                         48

 

Chapter 7. Implementation                                                                                   49

 

Chapter 8. Testing                                                                                                51

 

Chapter 9. Conclusion                                                                                          51

 

Bibliography                                                                                                         52

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

CHAPTER 1:      INTRODUCTION

 

·        INTRODUCTION  TO  MXC DESIGN WEBSITE

 

MXC Design is based in the Hollywood Hills, California and Seattle, Washington. The design focuses on a "warm modernism"- a fusion of clean lines and Asian influences with natural materials, finely detailed and crafted.

Matthew X. Curry studied at Pratt Institute's School of Architecture in New York. His architectural training has informed all areas of his multi-faceted career, including interior and furniture design, as well as fine art. During an invaluable year spent in Prague, Matthew focused upon his fine art. He self-published a book of his work and co-hosted a USC seminar on international land use.

Matthew has had the good fortune to practice in diverse arenas including yacht interiors, legal/investment firms, celebrity offices, screening rooms, restaurants and night clubs. His residential projects have ranged from 150 to 26,000 square feet. His work has appeared in several magazines, the occasional gallery, and on TV/Cable and will be featured on HGTV's "Generation Renovation" airing in 2006.

·        OBJECTIVE OF MXC DESIGN WEBSITE:

The goal of MXC Design  web site development project is to introduce and explore Mathew’s high talented skills and profession to the world. The project started in Synergy Corporate Technologies by Yashesh B. Rajyaguru(.NET developer) and Patrick Meagher(IT Vice President) on 18th Jan 2006 .

The project is developed on .NET technologies using ASP.NET, C#.NET, ADO.NET and the data tables are created and stored into sql server 2000. I was involved in the entire development life cycle of this project.

I have tried to explain the project in detail in this thesis to make everyone familiar with the business methodologies and development strategies in real time system.

For a new developer or .NET learner I have given enough information in chapter 3 to step by step approach for web development.

 

·        MAIN MODULES OF THE WEBSITE DESIGN:

1.      Design the Web Pages for MXC Design websites using Macromedia technologies like dreamweaver.

2.      To Display the Portfolio gallery using datalist in ASP.NET.

3.      Display the thumbnails of the particular selected category.

4.      Enlarge the thumbnail into a new page with its description and quote number.

5.    Creating a virtual tour file for the interiors.

6.      Architecture of data tables into SQL  server 2000.

 

·        SYNERGY CORPORATE TECHNOLOGIES, WESTPORT, CT

How could I forget to provide an introduction to Synergy Corporate Technologies.

Synergy Corporate Technology is situated in Westport, CT, USA. The other branches are in UK and South Africa. It provides mainly three different services –

1.      Development services – website design, online marketing, Application development, Portfolio and interactive.

2.      Technical services – Managed services, Purchased services, Help desk, IT support, Hosting and co-location.

3.      Business solutions- Business portals, Accounting, CRM and case studies.

 

 

 

 

 

CHAPTER 2:   INTRODUCTION TO .NET

The .NET Framework is the infrastructure for the Microsoft .NET platform. 

The .NET Framework is an environment for building, deploying, and running Web applications and Web Services.

The .NET Framework contains a common language runtime and common class libraries - like ADO.NET, ASP.NET and Windows Forms - to provide advanced standard services that can be integrated into a variety of computer systems.

The .NET Framework provides a feature-rich application environment, simplified development and easy integration between a number of different development languages.

The .NET Framework is language neutral. Currently it supports C++, C#, Visual Basic, and JScript (Microsoft's version of JavaScript).

Microsoft's Visual Studio.NET is a common development environment for the .NET Framework.

I Classic ASP

Active Server Pages (ASP) has been around for several years. With ASP, executable code can be placed inside HTML pages.

Previous versions of ASP (before ASP .NET) are often called Classic ASP.

ASP .NET is not fully compatible with Classic ASP, but most Classic ASP pages will work fine as ASP .NET pages, with only minor changes.

 

II ASP.NET

Important features of ASP.NET are:

1.      ASP.NET is completely compiled code on the server side as opposed to interpreted code in the traditional ASP technology. This helps improves the performance of the web site greatly.

2.      ASP.NET is completely object-oriented as the entire code is written in one of the

3.       

4.       

5.      .Net languages (C# being the most common and most powerful). Traditional ASP used the ActiveX/COM technology to create tiered architectures and give the server-side the code somewhat of an object-oriented feel. Traditional ASP also used ActiveX/COM components to accomplish sophisticated tasks such as sockets, sending emails, uploading files to the server etc.. ASP.NET eliminates the need to use ActiveX/COM components as the entire framework class library is available to accomplish any sophisticated task.

6.      ASP.NET provides a clean separation between the GUI and the server-side code. Each web page typically has two parts to it: a .aspx file containing the HTML presentation, and a code behind file (with .cs or .vb extension) containing the related server-side code. Thus by default, the ASP.NET provides a 2-Tier architecture which can be easily implemented as a multi-tier design as the complexity of the web application increases.

7.      ASP.NET further improves the performance by providing powerful server-side caching of the executed code for a faster response to the client.

8.      The associated ADO.NET technology for dealing with databases also has smart caching of records available in the form of the dataset for a very high performance data driven web application.

9.      ASP.NET is backwards compatible with the classical ASP technology.

10.  ASP.NET has a much easier deployment of web applications. Simply copy the web application directory to a target machine and set up the appropriate virtual directory to run the application.

11.  ASP.NET can use the ActiveX/COM components if needed through the RCW (Runtime Class Wrapper) feature of .Net. Although all new development in ASP.NET can be accomplished without the ActiveX/COM components.

12.  For creating scalable, tiered architectures, ASP.NET still uses the COM+ technology. However, the COM+ programming is made much simpler by the use of special attributes that can be specified for the .Net classes that will be converted to COM+ components.

13.  ASP.NET provides excellent client-side data validation in the form of specialized validators. These validators generate the appropriate client-side Javascript code for data validation on the client side. Thus the need to program in Javascript directly on the client-side is greatly reduced.

14.  ASP.NET provides a powerful server-side event driven model for web application development where different HTML elements (server controls) on the client-side trigger events on the server-side (the associated code behind file for the aspx file contains the event handlers for these events).

15.  ASP.NET provides a very easy way to maintain the state of client-side elements once a server-side event is triggered by one of these elements and the form is submitted to the server.

16.  ASP.NET provides an AutoPostBack property for server-side controls so that if anything is changed in the control, the data is posted to the web server. For example, if a checkbox is checked or unchecked, the server-side event handler can be triggered if its AutoPostBack property is set to true.

17.  Although Visual Studio.Net is not required for developing ASP.NET applications, it makes the web application development much easier by providing an array of server-side controls, their visual placement and writing of the skeleton code for the event handlers for these.

18.  ASP.NET and Visual Studio.NET provide powerful support for creating web services and web services based distributed applications.

*The above important features are been taught by Professor Mahmood, Computer Science and Engineering Department, University of Bridgeport.

 

1. Dynamic Page in ASP .NET

This following code displays our example as an ASP .NET page:

<html>
<body bgcolor="Green">
<center>
<h2>Hello University of Bridgeport!</h2>
<p><%Response.Write(now())%></p>
</center>
</body>

</html>

 

2. ASP.NET - Server Controls

ASP.NET has solved the "spaghetti-code" problem described above with server controls.

Server controls are tags that are understood by the server.

There are three kinds of server controls:

 

2. 1 ASP.NET - HTML Server Controls

HTML server controls are HTML tags understood by the server.

HTML elements in ASP.NET files are, by default, treated as text. To make these elements programmable, add a runat="server" attribute to the HTML element. This attribute indicates that the element should be treated as a server control. The id attribute is added to identify the server control. The id reference can be used to manipulate the server control at run time.

Note: All HTML server controls must be within a <form> tag with the runat="server" attribute. The runat="server" attribute indicates that the form should be processed on the server. It also indicates that the enclosed controls can be accessed by server scripts.

In the following example we declare an HtmlAnchor server control in an .aspx file. Then we manipulate the HRef attribute of the HtmlAnchor control in an event handler (an event handler is a subroutine that executes code for a given event). The Page_Load event is one of many events that ASP.NET understands:

<script runat="server">
Sub Page_Load
link1.HRef="http://www.bridgeport.edu"
End Sub
</script>
<html>
<body>
<form runat="server">
<a id="link1" runat="server">University of Bridgeport</a>
</form>
</body>

</html>

The executable code itself has been moved outside the HTML.

2.2 ASP.NET - Web Server Controls

Web server controls are special ASP.NET tags understood by the server.

Like HTML server controls, Web server controls are also created on the server and they require a runat="server" attribute to work. However, Web server controls do not necessarily map to any existing HTML elements and they may represent more complex elements.

The syntax for creating a Web server control is:

<asp:control_name id="idname" runat="server" />

In the following example we declare a Button server control in an .aspx file. Then we create an event handler for the Click event which changes the text on the button:

 

<script runat="server">
Sub submit(Source As Object, e As EventArgs)
button1.Text="You clicked The University of bridgeport!"
End Sub
</script>
<html>
<body>
<form runat="server">
<asp:Button id="button1" Text="Click me!"
runat="server" OnClick="submit"/>
</form>
</body>

</html>

 

2.3 ASP.NET - Validation Server Controls

Validation server controls is used to validate user-input. If the user-input does not pass validation, it will display an error message to the user.

Each validation control performs a specific type of validation (like validating against a specific value or a range of values).

By default, page validation is performed when a Button, ImageButton, or LinkButton control is clicked. You can prevent validation when a button control is clicked by setting the CausesValidation property to false.

The syntax for creating a Validation server control is:

<asp:control_name id="idname" runat="server" />

In the following example we declare one TextBox control, one Button control, and one RangeValidator control in an .aspx file. If validation fails, the text "The value must be from 1 to 100!" will be displayed in the RangeValidator control:

<html>
<body>
<form runat="server">
Enter a number from 1 to 100:
<asp:TextBox id="tbox1" runat="server" />
<br /><br />
<asp:Button Text="Submit" runat="server" />
<br />
<asp:RangeValidator
ControlToValidate="tbox1"
MinimumValue="1"
MaximumValue="100"
Type="Integer"
EnableClientScript="false"
Text="The value must be from 1 to 100!"
runat="server" />
</form>
</body>

</html>

3. ASP.NET – Events

 

Phase

What a control needs to do

Method or event to override

Initialize

Initialize settings needed during the lifetime of the incoming Web request.

Init event (OnInit method)

Load view state

At the end of this phase, the ViewState property of a control is automatically populated as described in Maintaining State in a Control. A control can override the default implementation of the LoadViewState method to customize state restoration.

LoadViewState method

Process postback data

Process incoming form data and update properties accordingly.

LoadPostData method (if IPostBackDataHandler is implemented)

Load

Perform actions common to all requests, such as setting up a database query. At this point, server controls in the tree are created and initialized, the state is restored, and form controls reflect client-side data.

Load event

(OnLoad method)

Send postback change notifications

Raise change events in response to state changes between the current and previous postbacks.

RaisePostDataChangedEvent method (if IPostBackDataHandler is implemented)

Handle postback events

Handle the client-side event that caused the postback and raise appropriate events on the server.

RaisePostBackEvent method(if IPostBackEventHandler is implemented)

Prerender

Perform any updates before the output is rendered. Any changes made to the state of the control in the prerender phase can be saved, while changes made in the rendering phase are lost.

PreRender event
(OnPreRender method)

Save state

The ViewState property of a control is automatically persisted to a string object after this stage. This string object is sent to the client and back as a hidden variable. For improving efficiency, a control can override the SaveViewState method to modify the ViewState property.

SaveViewState method

Render

Generate output to be rendered to the client.

Render method

Dispose

Perform any final cleanup before the control is torn down. References to expensive resources such as database connections must be released in this phase.

Dispose method

Unload

Perform any final cleanup before the control is torn down. Control authors generally perform cleanup in Dispose and do not handle this event.

UnLoad event (On UnLoad method)

 

4.      ASP.NET Web Forms

All server controls must appear within a <form> tag, and the <form> tag must contain the runat="server" attribute. The runat="server" attribute indicates that the form should be processed on the server. It also indicates that the enclosed controls can be accessed by server scripts:

<form runat="server">
...HTML + server controls

</form>

An .aspx page can only contain ONE <form runat="server"> control!

If you select view source in an .aspx page containing a form with no name, method, action, or id attribute specified, you will see that ASP.NET has added these attributes to the form. It looks something like this:

<form name="_ctl0" method="post" action="page.aspx" id="_ctl0">
...some code

</form>

 

Submitting a Form

A form is most often submitted by clicking on a button. The Button server control in ASP.NET has the following format:

<asp:Button id="id" text="label" OnClick="sub" runat="server" />

The id attribute defines a unique name for the button and the text attribute assigns a label to the button. The onClick event handler specifies a named subroutine to execute.

 

 

 

 

5. ASP .NET ViewState

 

Web pages are recreated each time the page is posted to the server. In traditional Web programming, this would ordinarily mean that all information associated with the page and the controls on the page would be lost with each round trip.
To overcome this inherent limitation of traditional Web programming, the ASP.NET page framework includes various options to help you preserve changes — that is, for managing state. The page framework includes a facility called view state that automatically preserves property values of the page and all the controls on it between round trips.
However, you will probably also have application-specific values that you want to preserve. To do so, you can use one of the state management options.
Client-Based State Management Options:
View State
Hidden Form Fields
Cookies
Query Strings
Server-Based State Management Options
Application State
Session State
Database Support

 

Automatic view-state management is a feature of server controls that enables them to repopulate their property values on a round trip (without you having to write any code). This feature does impact performance, however, since a server control's view state is passed to and from the server in a hidden form field. You should be aware of when view state helps you and when it hinders your page's performance.

 

6. ASP.NET CONTROLS:

 

6.1  ASP .NET - The TextBox Control

The TextBox control is used to create a text box where the user can input text.

The example below demonstrates some of the attributes you may use with the TextBox control:

 

<html>
<body>
 
<form runat="server">
 
A basic TextBox:
<asp:TextBox id="txtName" runat="server" />
<br /><br />
 
A password TextBox:
<asp:TextBox id="txtPassword" TextMode="password" runat="server" />
<br /><br />
 
A TextBox with text:
<asp:TextBox id="txtUB" Text="WELCOME TO UNIVERSITY OF BRIDGEPORT!" runat="server" />
<br /><br />
 
A multiline TextBox:
<asp:TextBox id="txtaddress" TextMode="multiline" runat="server" />
<br /><br />
 
</form>
 
</body>

</html>

 

 

Add a Script

The contents and settings of a TextBox control may be changed by server scripts when a form is submitted. A form can be submitted by clicking on a button or when a user changes the value in the TextBox control.

In the following example we declare one TextBox control, one Button control, and one Label control in an .aspx file. When the submit button is triggered, the submit subroutine is executed. The submit subroutine writes a text to the Label control:

<script runat="server">
Sub submit(sender As Object, e As EventArgs)
lbl1.Text="University of Bridgport: " & txt1.Text
End Sub
</script>

 

 

 

 

 

6.2 ASP.NET - The Button Control

 Button control is used to display a clicked button. The clicked button may be a submit button or a command button. By default, this control is a submit button.

A submit button does not have a command name and it posts the page back to the server when it is clicked. It is possible to write an event handler to control the actions performed when the submit button is clicked.

A command button has a command name and allows you to create multiple Button controls on a page. It is possible to write an event handler to control the actions performed when the command button is clicked.

The example below demonstrates a simple Button control:

<html>
<body>
 
<form runat="server">
<asp:Button id="btnSubmit" Text="Submit" runat="server" />
</form>
</body>

</html>

 

7.  ASP.NET - Data Binding

 

We may use data binding to fill lists with selectable items from an imported data source, like a database, an XML file, or a script.

Data Binding

The following controls are list controls which support data binding:

The selectable items in each of the above controls are usually defined by one or more asp:ListItem controls, like this:

 

<html>
<body>
<form runat="server">
<asp:RadioButtonList id="Studentlist" runat="server">
<asp:ListItem value="Y" text="Yashesh" />
<asp:ListItem value="R" text="Rajyaguru" />
</asp:RadioButtonList>
</form>
</body>

</html>

However, with data binding we may use a separate source, like a database, an XML file, or a script to fill the list with selectable items.

By using an imported source, the data is separated from the HTML, and any changes to the items are made in the separate data source.

8. ASP.NET - The ArrayList Object

 

The ArrayList object is a collection of items containing a single data value.

Create an ArrayList

The ArrayList object is a collection of items containing a single data value.

Items are added to the ArrayList with the Add() method.

The following code creates a new ArrayList object named myname and four items are added:

<script runat="server">
Sub Page_Load
if Not Page.IsPostBack then
  dim myname=New ArrayList
  myname.Add("Yashesh")
  myname.Add("Rajyaguru")
end if
end sub

</script>

By default, an ArrayList object contains 16 entries. An ArrayList can be sized to its final size with the TrimToSize() method:

<script runat="server">
Sub Page_Load
if Not Page.IsPostBack then
  dim myname=New ArrayList
  myname.Add("Yashesh")
  myname.Add("Rajyaguru")
  myname.TrimToSize()
end if
end sub

</script>

An ArrayList can also be sorted alphabetically or numerically with the Sort() method:

<script runat="server">
Sub Page_Load
if Not Page.IsPostBack then
  dim myname=New ArrayList
  myname.Add("Yashesh")
  myname.Add("Rajyaguru")
  myname.TrimToSize()
  myname.Sort()
end if
end sub

</script>

To sort in reverse order, apply the Reverse() method after the Sort() method:

<script runat="server">
Sub Page_Load
if Not Page.IsPostBack then
  dim myname=New ArrayList
  myname.Add("Yashesh")
  myname.Add("Rajyaguru")
  myname.TrimToSize()
  myname.Sort()
  myname.Reverse()
end if
end sub

</script>

 

9. ASP.NET - The DataList Control

The DataList control is, like the Repeater control, used to display a repeated list of items that are bound to the control. However, the DataList control adds a table around the data items by default.

Example 1

<%@ Import Namespace="System.Data" %>

<script  runat="server">
sub Page_Load
if Not Page.IsPostBack then
   dim myportfolio=New DataSet
   myportfolio.ReadXml(MapPath("portfolio.xml"))
   portfolio.DataSource=myportfolio
   portfolio.DataBind()
end if
end sub
</script>

<html>
<body>
<form runat="server">
<asp:DataList
id="portfolio"
gridlines="Both"
runat="server">

<HeaderTemplate>
My CD Catalog
</HeaderTemplate>

<ItemTemplate>
"<%#Container.DataItem("title")%>" of <%#Container.DataItem("artist")%>  - $<%#Container.DataItem("price")%>
</ItemTemplate>

<FooterTemplate>
© Hege Refsnes
</FooterTemplate>

</asp:DataList>
</form>

</body>
</html>

 

10. ASP.NET - Database Connection

ADO.NET is also a part of the .NET Framework. ADO.NET is used to handle data access. With ADO.NET you can work with databases.

Steps:

10.1. Create a Database Connection

We are going to use the Akira database in our examples.

First, import the "System.Data.OleDb" namespace. We need this namespace to work with Microsoft Access and other OLE DB database providers. We will create the connection to the database in the Page_Load subroutine. We create a dbconn variable as a new OleDbConnection class with a connection string which identifies the OLE DB provider and the location of the database. Then we open the database connection:

<%@ Import Namespace="System.Data.OleDb" %>
<script runat="server">
sub Page_Load
dim dbconn
dbconn=New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;
data source=" & server.mappath("Akira.mdb"))
dbconn.Open()
end sub

</script>

10.2. Create a Database Command

To specify the records to retrieve from the database, we will create a dbcomm variable as a new OleDbCommand class. The OleDbCommand class is for issuing SQL queries against database tables:

 

<%@ Import Namespace="System.Data.OleDb" %>
<script runat="server">
sub Page_Load
dim dbconn,sql,dbcomm
dbconn=New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;
data source=" & server.mappath("Akira.mdb"))
dbconn.Open()
sql="SELECT * FROM Portfolio"
dbcomm=New OleDbCommand(sql,dbconn)
end sub

</script>

 

10.3. Create a DataReader

The OleDbDataReader class is used to read a stream of records from a data source. A DataReader is created by calling the ExecuteReader method of the OleDbCommand object:

<%@ Import Namespace="System.Data.OleDb" %>
<script runat="server">
sub Page_Load
dim dbconn,sql,dbcomm,dbread
dbconn=New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;
data source=" & server.mappath("Akira.mdb"))
dbconn.Open()
sql="SELECT * FROM Portfolio"
dbcomm=New OleDbCommand(sql,dbconn)
dbread=dbcomm.ExecuteReader()
end sub

</script>

10.4. Bind to a Repeater Control

Then we bind the DataReader to a Repeater control:

<%@ Import Namespace="System.Data.OleDb" %>
<script runat="server">
sub Page_Load
dim dbconn,sql,dbcomm,dbread
dbconn=New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;
data source=" & server.mappath("Akira.mdb"))
dbconn.Open()
sql="SELECT * FROM Portfolio"
dbcomm=New OleDbCommand(sql,dbconn)
dbread=dbcomm.ExecuteReader()
Portfolio.DataSource=dbread
Portfolio.DataBind()
dbread.Close()

 

 

 

10.5 Close the Database Connection

Always close both the DataReader and database connection after access to the database is no longer required:

dbread.Close()

dbconn.Close()

11. Web Server Controls

 

Web server controls are special ASP.NET tags understood by the server.

Like HTML server controls, Web server controls are also created on the server and they require a runat="server" attribute to work. However, Web server controls do not necessarily map to any existing HTML elements and they may represent more complex elements.

The syntax for creating a Web server control is:

<asp:control_name id="some_id" runat="server" />

 

 

Web Server Control

Description

AdRotator

Displays a sequence of images

Button

Displays a push button

Calendar

Displays a calendar

CheckBox

Displays a check box

CheckBoxList

Creates a multi-selection check box group

DataGrid

Displays fields of a data source in a grid

DataList

Displays items from a data source by using templates

DropDownList

Creates a drop-down list

HyperLink

Creates a hyperlink

Image

Displays an image

ImageButton

Displays a clickable image

Label

Displays static content which is programmable (lets you apply styles to its content)

LinkButton

Creates a hyperlink button

ListBox

Creates a single- or multi-selection drop-down list

Literal

Displays static content which is programmable (does not let you apply styles to its content)

Panel

Provides a container for other controls

PlaceHolder

Reserves space for controls added by code

RadioButton

Creates a radio button

RadioButtonList

Creates a group of radio buttons

Repeater

Displays a repeated list of items bound to the control

Table

Creates a table

TableCell

Creates a table cell

TableRow

Creates a table row

TextBox

Creates a text box

Xml

Displays an XML file or the results of an XSL transform

 

12. Validation Server Controls

A Validation server control is used to validate the data of an input control. If the data does not pass validation, it will display an error message to the user.

The syntax for creating a Validation server control is:

<asp:control_name id="some_id" runat="server" />

 

Validation Server Control

Description

Compare Validator

Compares the value of one input control to the value of another input control or to a fixed value

Custom Validator

Allows you to write a method to handle the validation of the value entered

Range Validator

Checks that the user enters a value that falls between two values

RE Validator

Ensures that the value of an input control matches a specified pattern

Required Filed Validator

Makes an input control a required field

Validation Summary

Displays a report of all validation errors occurred in a Web page

 

CHAPTER 3: SYSTEM DEFINITION:

 

·        OBJECTIVE OF MXC DESIGN:

 

The goal of MXC Design  web site development project is to introduce and explore Mathew’s high talented skills and profession to the world.

 

·        SYSTEM REQUIREMENT:

 

1). HARDWARE REQUIREMENT:

 

  1. Pentium III system or higher.
  2. Minimum 64 MB RAM
  3. 56 kbps Modem or more.

 

2). SOFTWARE REQUIREMENT:

 

  1. Visual Studio 2003 or latest.
  2. .NET framework 1.1 or 2.0
  3. SQL server 2000
  4. Internet explorer
  5. Firefox
  6. Microsoft Outlook Express
  7. Windows 98 or higher/ iMAC

 

·        USER REQUIREMENTS:

 

    1. All user should be authorized to the web pages of MXC Design website.
    2. Users should able to navigate into the system.
    3. Main navigation bar menus:  home, portfolio, info, bio, contact.
    4. Creating data tables for the portfolio categories.
    5. Displaying the items of the selected category into datalist.
    6. Should display only five items on one page.
    7. Paging technique required if more than five in a category.
    8. The selected thumbnail should come with a medium picture on the same screen along with title and description.
    9. Click on medium image should open a new window with a large image of the clicked item.
    10. These all needs to be done only by the single page name portfolio.
    11. On information page  need three links : Bio, artist’s statement and personnel experience.
    12. all links should open in new page.
    13. the design of the web pages should be unique in all the pages.
    14. Navigation bar should remain same without jumping.
    15. Follow strictly to the design template for designing the web pages.

 

 

 

 

CHAPTER 4: DESIGN

 

To implement a stable and accurate web based application, design of a project should be done very accurately. This chapter focuses on the design of overall architecture.

 

MACRO LEVEL DESIGN: ( Navigation system of the web site)

 

 


                                                                                                  

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

DATA DICTIONARY:

 

DATA BASE

RECORD FORMAT

1. PORTFOLIO

CATEGORYID, PORTFOLIOID, CATEGORYNAME, TITLE, DESCRIPTION, SMALLPIC, MEDIUMPIC, LARGEPIC.

2. CATEGORY

CATEGORYID, CTEGORYNAME

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

CHAPTER 4: CODE DESCRIPTION

 

A.     To Display the Portfolio gallery using datalist in ASP.NET.

B.     Display the thumbnails of the particular selected category.

C.     Enlarge the thumbnail into a new page with its description and quote number.

D.   Creating a virtual tour file for the interiors.

 

I have created a template using macrmedia dreamweaver 6. I created the frame and tables to display the images, datalist and descriptions.

I have written the java script functions to display the images into the medium box. On the home page, the image appears one by one in the imagebox from the sql data table.

The code for that is written inside the four java script function inside the head tag.

 

function popupWindow(fileName)

To pop up a new window everytime when a medium image is clicked.

It is going to parse the filename as a url.

 

To display the images on the home page and swap them :

function MM_PreloadImages() , function MM_swapImgRestore(),function MM_findObj(n, d), function MM_swapImage().

 

I created styles.css file and defined the majority of the font, color, background and images.

To include the style sheet in all the web pages, following link tag is very important.

 

Te code written in my files and classes are very self explanatory.Moreover, I have written the comment lines at all necessary lines.

 

When a user selects a portfolio option into the nav bar. The portfoliogallery.aspx displays. The portfoliogallery page itself has a datalist in it where the portfolio itmes are displayed as  thumbnails.

 

Web pages are recreated each time the page is posted to the server. In traditional Web programming, this would ordinarily mean that all information associated with the page and the controls on the page would be lost with each round trip.
To overcome this inherent limitation of traditional Web programming, the ASP.NET page framework includes various options to help you preserve changes — that is, for managing state. The page framework includes a facility called view state that automatically preserves property values of the page and all the controls on it between round trips.
However, you will probably also have application-specific values that you want to preserve. To do so, you can use one of the state management options.
Client-Based State Management Options:
View State
Hidden Form Fields
Cookies
Query Strings
Server-Based State Management Options
Application State
Session State
Database Support

 

Automatic view-state management is a feature of server controls that enables them to repopulate their property values on a round trip (without you having to write any code). This feature does impact performance, however, since a server control's view state is passed to and from the server in a hidden form field. You should be aware of when view state helps you and when it hinders your page's performance.

 

This is shown in the code below : Portfoliogallery.aspx.vb

 

 

PORTFOLIOGALLERY.ASPX:

 

<!--CODED BY YASHESH RAJYAGURU - .NET DEVELOPER, SYNERGY CORPORTATE TECHNOLOGY.-->

<%@ Page Language="vb" AutoEventWireup="false" Codebehind="PortfolioGallery.aspx.vb" Inherits="MXCDesign_Website.PortfolioGallery"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<HTML>

            <HEAD>

                        <title>MXC Design - Portfolio</title>

                        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

                        <meta name="Description" content="Dynamic art and interior design by Matthew X Curry">

                        <meta name="Keywords" content="MXC Design, Matthew X Curry, Matt Curry, Hollywood, HGTV, Los Angeles, interior design, interiors, contemporary, modern, decorative, unusual, timeless, style, beauty, visionary, mysterious, vital, balanced, complex, dynamic, New York, Cleveland, Prague, Seattle, dining room, dining tables, end tables, vanity tables, millwork, woodwork, metal, glass, steel, Douglas Vertical Fir, granite, bathrooms, retreats, kitchens, bedroom, consoles, color">

<!--STYLE SHEET LINKS - - >

                        <LINK href="styles.css" type="text/css" rel="stylesheet"></LINK>

<!--JAVA SCRIPT FUNCTION -->

           

<script language="javascript" type="text/javascript">

                       

                        function popupWindow(fileName)

                        {

                                    var theURL =  fileName;

                                    window.open(theURL, 'newWin', 'height=500,width=400');                             

                        }

   

    function MM_PreloadImages()

    {

                        var d=document; if(d.images)

                        {

                        if(!d.MM_p) d.MM_p=new Array();

                        var i, j=d.MM_p.length, a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)

                        if (a[i].indexOf('#')!=0) { d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}

                        }

            }

            function MM_swapImgRestore()

            {

                        var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;

            }

 

            function MM_findObj(n, d)

            {

                        var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length)

                        {

                        d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);

                        }

                        if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];

                        for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);

                        if(!x && d.getElementById) x=d.getElementById(n); return x;

            }

    

            function MM_swapImage()

            {

                        var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)

                        if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}

            }

                       

   

                        </script>

            </HEAD>

            <body>

                        <form id="Form1" method="post" runat="server">

                                    <br>

                                    <br>

                                    <br>

                                    <table cellSpacing="0" cellPadding="0" width="778" align="center" border="0">

                                                <tr>

                                                            <td width="46"><IMG height="40" src="images/bgBlock.jpg" width="38"></td>

                                                            <td width="701"><IMG height="40" src="images/topHeadingV.jpg" width="701"></td>

                                                            <td background="images/leftBlock.jpg"><img src="images/spacer.gif" width="39" height="40"></td>

                                                </tr>

                                    </table>

                                    <table cellSpacing="0" cellPadding="0" width="778" align="center" bgColor="#9a6601" border="0">

                                                <tr vAlign="top">

                                                            <td width="38" bgColor="#343434"><IMG height="182" src="images/bgBlock.jpg" width="38"></td>

                                                            <td class="div_nav_bg" bgColor="#9a6601" colSpan="3">

                                                                        <table cellSpacing="0" cellPadding="0" width="100%" border="0">

                                                                                    <tr>

                                                                                                <td colspan="2" bgcolor="#959a9d" height="9"><img src="images/topV_2.jpg" width="216" height="9"></td>

                                                                                    </tr>

                                                                                    <tr>

                                                                                                <td width="117" bgColor="#959a9d">&nbsp;</td>

<! – this image logo is between the two tables nav bar and body -- >

 

                                                                                                <td><IMG height="131" src="images/topLogo.jpg" width="99"></td>

                                                                                    </tr>

                                                                                    <tr>

                                                                                                <td bgColor="#959a9d" height="14">&nbsp;</td>

                                                                                                <td>&nbsp;</td>

                                                                                    </tr>

                                                                                    <tr>

                                                                                                <td colSpan="2" valign="top" bgcolor="#959a9d">

                                                                                                            <table cellSpacing="0" cellPadding="0" border="0">

                                                                                                                        <tr>

                                                                                                                                    <td vAlign="top" width="174" background="images/NavBG.jpg"><IMG height="10" src="images/NavBG.jpg" width="216"></td>

                                                                                                                        </tr>

                                                                                                                        <tr>

                                                                                                                                    <td vAlign="top" background="images/NavBG.jpg"><table cellSpacing="0" cellPadding="0" border="0">

                                                                                                                                                            <tr>

                                                                                                                                                                        <td vAlign="top" width="100"><A href="default.aspx"><IMG height="28" src="images/nav_home.jpg" width="100" border="0"></A><A href="portfoliogallery.aspx"><IMG height="28" src="images/nav_protfolio_bar.jpg" width="100" border="0"></A><A href="info.aspx"><IMG height="28" src="images/nav_info.jpg" width="100" border="0"></A><A href="contact.aspx"><IMG height="28" src="images/nav_contact.jpg" width="100" border="0"></A></td>

                                                                                                                                                                        <td vAlign="top" width="74"><IMG height="30" src="images/spacer.gif"

width="74">

 

<! – Code for on mouse over and mouse off image -- >

<! – Command argument is specified with each category and it is defined in the .vb file -- >

 

 <A onmouseover="MM_swapImage('imgInteriors','','images/nav_protfolio_interiors.jpg', 1)">

                                                                                                                                                                                                <asp:imagebutton id="imgInteriors" CommandArgument="1" BorderWidth="0" ImageUrl="images/nav_protfolio_interiors.jpg"

                                                                                                                                                                                                            Runat="server" name="imgInteriors"></asp:imagebutton></A><BR>

                                                                                                                                                                                    <A onmouseover="MM_swapImage('imgFurniture','','images/nav_protfolio_furniture.jpg', 1)">

                                                                                                                                                                                                <asp:imagebutton id="imgFurniture" CommandArgument="2" BorderWidth="0" ImageUrl="images/nav_protfolio_furniture.jpg"

                                                                                                                                                                                                            Runat="server" name="imgFurniture"></asp:imagebutton></A><BR>

                                                                                                                                                                                    <A onmouseover="MM_swapImage('imgColorart','','images/nav_protfolio_colorart.jpg', 1)">

                                                                                                                                                                                                <asp:imagebutton id="imgColorart" CommandArgument="3" BorderWidth="0" ImageUrl="images/nav_protfolio_colorart.jpg"

                                                                                                                                                                                                            Runat="server" name="imgColorart" DESIGNTIMEDRAGDROP="60"></asp:imagebutton></A><BR>

                                                                                                                                                                                    <A onmouseover="MM_swapImage('imgBwart','','images/nav_protfolio_Bwart.jpg', 1)">

                                                                                                                                                                                                <asp:imagebutton id="imgBw" CommandArgument="4" BorderWidth="0" ImageUrl="images/nav_protfolio_bwart.jpg"

                                                                                                                                                                                                            Runat="server" name="imgBw"></asp:imagebutton></A><BR>

                                                                                                                                                                        </td>

                                                                                                                                                            </tr>

                                                                                                                                                </table>

                                                                                                                                    </td>

                                                                                                                        </tr>

                                                                                                            </table>

                                                                                                </td>

                                                                                    </tr>

                                                                                    <tr>

                                                                                                <td colSpan="2"><IMG height="100" src="images/spacer.gif" width="34"></td>

                                                                                    </tr>

                                                                        </table>

                                                            </td>

                                                            <td width="524">

                                                                        <table cellSpacing="0" cellPadding="0" width="100%" border="0">

                                                                                    <tr>

                                                                                                <td vAlign="top" align="right">

                                                                                                            <div class="div_title"><strong>Portfolio</strong></div>

                                                                                                </td>

                                                                                    </tr>

                                                                                    <tr>

                                                                                                <td vAlign="top"><br>

                                                                                                            <table cellSpacing="0" cellPadding="0" border="0" width="484" height="200">

                                                                                                                        <tr>

                                                                                                                                    <td valign="top" align="center">

                                                                                                                                                <asp:label id="lblTitle" Runat="server" Font-Bold="True" Font-Size="12px"></asp:label><br>

                                                                                                                                                <br>

                                                                                                                                                <asp:label id="lblDescription" Runat="server" Font-Size="11px"></asp:label>

                                                                                                                                    </td>

                                                                                                                                    <td width="223" height="171" align="right"><a id="linkLargeImage" target="_blank" runat="server"><asp:image id="imgPicture1" Runat="server" ImageAlign="Top"></asp:image></a></td>

                                                                                                                                    <td vAlign="top" width="36" rowSpan="2"></td>

                                                                                                                        </tr>

                                                                                                            </table>

                                                                                                            <br>

                                                                                                            <table cellSpacing="0" cellPadding="0" width="95%" align="center" border="0" height="80">

                                                                                                                        <TR>

                                                                                                                                    <td vAlign="bottom" align="right" width="5%"><BR>

                                                                                                                                                <asp:imagebutton id="imgPrevious" ImageUrl="images/arrow_previous.gif" Runat="server" ImageAlign="Left"></asp:imagebutton></td>

                                                                                                                                    <TD><asp:datalist id="dlImages" BorderWidth="0px" Runat="server" Width="100%" DataKeyField="ItemID"

                                                                                                                                                            RepeatLayout="Flow" RepeatColumns="5" CellSpacing="0" CellPadding="0" ShowFooter="False" ShowHeader="False"

                                                                                                                                                            RepeatDirection="Horizontal" HorizontalAlign="CENTER" SeparatorStyle-BorderWidth="15">

                                                                                                                                                            <ItemTemplate>

                                                                                                                                                                        <asp:ImageButton ID="imgItem" CommandArgument='<%# DataBinder.Eval(Container.DataItem, "ImageName") %>' Runat="server" Width=18.5% ImageAlign="Middle" Height="75px">

                                                                                                                                                                        </asp:ImageButton>

                                                                                                                                                            </ItemTemplate>

                                                                                                                                                </asp:datalist></TD>

                                                                                                                                    <td vAlign="bottom" align="left" width="5%"><BR>

                                                                                                                                                <asp:imagebutton id="imgNext" ImageUrl="images/arrownext.gif" Runat="server" ImageAlign="Right"></asp:imagebutton></td>

                                                                                                                        </TR>

                                                                                                            </table>

                                                                                                </td>

                                                                                    </tr>

                                                                        </table>

                                                            </td>

                                                            <td background="images/leftBG.jpg" bgcolor="#333333"><IMG height="131" src="images/spacer.gif" width="39"></td>

                                                </tr>

                                    </table>

                                    <!--#include file="includes/footer.htm" -->

                        </form>

            </body>

</HTML>

 

 

 

 

 

 

 

 

 

 

 

 

 

 

PORTFOLIOGALLERY.ASPX.VB

 

 

'' CODED BY YASHESH RAJYAGURU, .NET DEVELOPER, SYNERGY CORPORATE TECHNOLOGY, WESTPORT, CT.

'' PORTFOLIOGALLERY.ASPX, DISPLAYS THE THUMBNAILS INTO DATALIST, MEDIUM IMAGE AND TITLE AND DESCRIPTION IN THE USER CONTROLS

 

 

Imports MXCDesign_Website

'IMPORTING PORTFOLIOLOGIC CLASS

Imports MXCDesign_Website.PortfolioLogic

 

Public Class PortfolioGallery

    Inherits System.Web.UI.Page

'  PAGE SIZE FOR THE THUMBNAIL IS DISPLAYED INTO THE DATALIST

    Const PageSize As Integer = 5

    Protected WithEvents lblTitle As System.Web.UI.WebControls.Label

    Protected WithEvents lblDescription As System.Web.UI.WebControls.Label

    Protected WithEvents imgNext As System.Web.UI.WebControls.ImageButton

    Protected WithEvents linkLargeImage As System.Web.UI.HtmlControls.HtmlAnchor

    Dim PageCount As Integer = 0

 

 

#Region " Web Form Designer Generated Code "

 

    'This call is required by the Web Form Designer.

    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

 

    End Sub

' DECLARING THE IMAGES AS BUTTONS.

    Protected WithEvents imgInteriors As System.Web.UI.WebControls.ImageButton

    Protected WithEvents imgFurniture As System.Web.UI.WebControls.ImageButton

    Protected WithEvents imgColorart As System.Web.UI.WebControls.ImageButton

    Protected WithEvents imgBw As System.Web.UI.WebControls.ImageButton

 

    Protected WithEvents imgPicture1 As System.Web.UI.WebControls.Image

    Protected WithEvents imgPrevious As System.Web.UI.WebControls.ImageButton

    Protected WithEvents dlImages As System.Web.UI.WebControls.DataList

 

    'NOTE: The following placeholder declaration is required by the Web Form Designer.

    'Do not delete or move it.

    Private designerPlaceholderDeclaration As System.Object

 

    Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init

        'CODEGEN: This method call is required by the Web Form Designer

        'Do not modify it using the code editor.

        InitializeComponent()

    End Sub

 

 

#End Region

' DECLARING THE TABLES, WIDTH AND HEIGHT.

    Dim table As DataTable

    Private Width As Integer = 345

    Private Height As Integer = 190

 

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        'Put user code to initialize the page here

        If Not Page.IsPostBack Then

            ' INITIALLY WE WANT TO DISPLAY INTERIORS CATEGORY BY DEFAULT.

            CategoryID = 1

                'CALLING BIND IMAGE FUNCTION.

            BindImages(CategoryID, True)

        End If

 

 

    End Sub

 

 

' BINDIMAGES SUB WILL DECLARE NEW PAGEDDATASOURCE.

' CALL THE GETALLITEMSBYCATEGORYID STORED PROCEDURE.

' PAGING

' NEXT AND PREVIOUS BUTTON CODES

    Private Sub BindImages(ByVal CategoryID As Integer, ByVal isrequestfromlist As Boolean)

 

       

            Dim pds As New PagedDataSource

            table = Item.GetAllItemsByCategoryID(CategoryID)

            pds.DataSource = table.DefaultView

            pds.AllowPaging = True

            pds.PageSize = PageSize

            pds.CurrentPageIndex = CurrentPage

 

 

 

            If pds.PageCount = 1 Then

                imgNext.Visible = False

                imgPrevious.Visible = False

            ElseIf pds.IsFirstPage Then

            imgNext.Visible = True

                imgPrevious.Visible = False

            ElseIf pds.IsLastPage Then

                imgNext.Visible = False

                imgPrevious.Visible = True

            Else

                imgNext.Visible = True

                imgPrevious.Visible = True

        End If

 

        dlImages.DataSource = pds

' BINDING DATA

        dlImages.DataBind()

' IF THE IMAGE EXISTS THE FILENAME WILL GET APPENED IN THE URL

        If isrequestfromlist = True And Not table.Rows.Count = 0 Then

            If table.Rows(0)("ImageName") Is DBNull.Value Then

                'imgPicture1.ImageUrl = "~/images/noImage.gif"

                Return

                'ElseIf table.Rows(0)("ImageName") = "" Then

                '    imgPicture1.ImageUrl = "~/images/noImage.gif"

            End If

        Else

            Dim bmpfile As New Bitmap(MapPath("images\Portfolio\") & table.Rows(0)("ImageName").ToString())

            If bmpfile.Width < 345 Then

                imgPicture1.Visible = True

                imgPicture1.ImageUrl = PortfolioLogic.Image.GetAppMediumImagePath(table.Rows(0)("ImageName"))

 

            End If

 

 

            lblTitle.Text = table.Rows(0)("Title")

            lblDescription.Text = table.Rows(0)("Description")

 

 

            lblTitle.Text = ""

            lblDescription.Text = ""

            imgPicture1.ImageUrl = "~/images/Portfolio/Medium"

            'imgPicture2.Visible = False

        End If

        ' linkLargeImage.HRef = Server.MapPath("images/Portfolio/Large/" & table.Rows(0)("ImageName").ToString())

        ' linkLargeImage.HRef = PortfolioLogic.Image.GetAppLargeImgPath(table.Rows(0)("ImageName").ToString())

 

        If Not Page.IsPostBack Then

            imgPicture1.ImageUrl = "~/images/Portfolio/Medium/" & table.Rows(0)("ImageName").ToString()

            lblTitle.Text = table.Rows(0)("Title").ToString()

            lblDescription.Text = table.Rows(0)("Description").ToString()

            If table.Rows(0)("ImageName").ToString() = "VirtualTour.jpg" Then

                'linkLargeImage.HRef = "~/IPIX/livingRoom.htm"

                linkLargeImage.Attributes.Add("onclick", "Javascript:popupWindow('/IPIX/livingRoom.htm')")

            Else

                linkLargeImage.HRef = PortfolioLogic.Image.GetAppLargeImgPath(table.Rows(0)("ImageName").ToString())

                linkLargeImage.Attributes.Remove("onclick")

            End If

            'If table.Rows(0)("ImageName").ToString() = "VirtualTour.jpg" Then

            '    linkLargeImage.HRef = Server.MapPath("images/Portfolio/Large/VirtualTour.exe")

            'Else

            '    linkLargeImage.HRef = Server.MapPath("images/Portfolio/Large/" & table.Rows(0)("ImageName").ToString())

            'End If

 

 

        End If

 

    End Sub

'TYPE CASTING

' IMAGEURL APPENDING WITH IMAGENAME

 

    Private Sub Item_dlImages(ByVal sender As Object, ByVal e As DataListItemEventArgs) Handles dlImages.ItemDataBound

        Select Case e.Item.ItemType

            Case ListItemType.AlternatingItem, ListItemType.Item

                Dim imgItem As ImageButton = CType(e.Item.FindControl("imgItem"), ImageButton)

                'imgItem.ImageUrl = "~/Images.aspx?tn=5&img=" + e.Item.DataItem("ImageName")

                imgItem.ImageUrl = "Images/Portfolio/small/" + e.Item.DataItem("ImageName")

        End Select

 

    End Sub

 

' ITEMCOMMAND_CLICK EVENT WILL CONVERT THR ITEMINDEX TO INTEGER AND STORE IN ITEMID.

' CHECK FOR THE IMAGEURL

' DISPLAYS THE VIRTUAL TOUR FOR INTERIORS

' INVOKES THE JAVA SCRIPT FUNCTION.

' CALLS GETAPPLICATIONMEDIUMIMAGE AND LARGEIMAGEPATH FUNCTIONS BY PASSING PARAMETERS AS ITS VALUE IMAGENAME ITSELF.

 

    Private Sub ItemCommand_Click(ByVal Sender As Object, ByVal e As DataListCommandEventArgs) Handles dlImages.ItemCommand

        Dim ItemID As Integer = Convert.ToInt32(dlImages.DataKeys(e.Item.ItemIndex))

        Dim theItem As New PortfolioLogic.Item(ItemID)

        theItem.GetItemByItemID()

        lblTitle.Text = theItem.Title

        lblDescription.Text = theItem.Description

 

        If theItem.ImageName = "" Then

            'imgPicture1.ImageUrl = "~/images/noImage.gif"

            Return

 

        ElseIf theItem.ImageName = "VirtualTour.jpg" Then

            imgPicture1.Visible = True

            imgPicture1.ImageUrl = PortfolioLogic.Image.GetAppMediumImagePath(theItem.ImageName)

            'linkLargeImage.HRef = PortfolioLogic.Image.GetAppLargeImgPath("VirtualTour.exe")

            'linkLargeImage.HRef = "~/IPIX/livingRoom.htm"

            linkLargeImage.HRef = ""

            linkLargeImage.Attributes.Add("onclick", "Javascript:popupWindow('/IPIX/livingRoom.htm')")

        Else

            ' Dim strImagePath As String = MapPath("images\Portfolio\") & theItem.ImageName

            Dim strImagePath As String = MapPath("images\Portfolio\Small\") & theItem.ImageName

 

            'Dim bmpfile As New Bitmap(MapPath("images\") & theItem.ImageName)

            'If bmpfile.Width < 345 Then

            imgPicture1.Visible = True

            imgPicture1.ImageUrl = PortfolioLogic.Image.GetAppMediumImagePath(theItem.ImageName)

            linkLargeImage.HRef = PortfolioLogic.Image.GetAppLargeImgPath(theItem.ImageName)

            linkLargeImage.Attributes.Remove("onclick")

        End If

 

 

    End Sub

 

    Private Property CurrentPage() As Integer

        Get

            Dim o As Object = ViewState("CurrentPage")

            If o Is Nothing Then Return 0 Else Return Convert.ToInt32(o)

        End Get

        Set(ByVal Value As Integer)

            ViewState.Add("CurrentPage", Value)

        End Set

    End Property

 

    Private Property CategoryID() As Integer

        Get

            Return ViewState("CategoryID")

        End Get

        Set(ByVal Value As Integer)

            ViewState.Add("CategoryID", Value)

        End Set

    End Property

    Private Sub imgPrevious_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles imgPrevious.Click

        CurrentPage = CurrentPage - 1

        BindImages(CategoryID, True)

 

    End Sub

    Private Sub imgNext_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles imgNext.Click

        CurrentPage = CurrentPage + 1

        BindImages(CategoryID, True)

 

    End Sub

'  INTERIOR CLICK SUB

    Private Sub imgInteriors_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles imgInteriors.Click

        CategoryID = imgInteriors.CommandArgument

        CurrentPage = 0

        'SetOffImages()

        '        imgPicture1.ImageUrl = "~/images/Portfolio/Medium/HollywoodHillsLivingRoom.jpg"

        BindImages(imgInteriors.CommandArgument, True)

 

        imgPicture1.ImageUrl = "~/images/Portfolio/Medium/" & table.Rows(0)("ImageName").ToString()

        lblTitle.Text = table.Rows(0)("Title").ToString()

        lblDescription.Text = table.Rows(0)("Description").ToString()

        If table.Rows(0)("ImageName").ToString() = "VirtualTour.jpg" Then

            ' linkLargeImage.HRef = PortfolioLogic.Image.GetAppLargeImgPath("VirtualTour.exe")

            'linkLargeImage.HRef = "~/IPIX/livingRoom.htm"

            linkLargeImage.HRef = ""

            linkLargeImage.Attributes.Add("onclick", "Javascript:popupWindow('/IPIX/livingRoom.htm')")

        Else

            linkLargeImage.HRef = PortfolioLogic.Image.GetAppLargeImgPath(table.Rows(0)("ImageName").ToString())

            linkLargeImage.Attributes.Remove("onclick")

        End If

    End Sub

 

' FURNITURE CLICK SUB

    Private Sub imgFurniture_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles imgFurniture.Click

 

        CategoryID = imgFurniture.CommandArgument

        CurrentPage = 0

        'SetOffImages()

        '  imgPicture1.ImageUrl = "~/images/Portfolio/Medium/QuebecTable.jpg"

        BindImages(imgFurniture.CommandArgument, True)

        imgPicture1.ImageUrl = "~/images/Portfolio/Medium/" & table.Rows(0)("ImageName").ToString()

        lblTitle.Text = table.Rows(0)("Title").ToString()

        lblDescription.Text = table.Rows(0)("Description").ToString()

        linkLargeImage.HRef = PortfolioLogic.Image.GetAppLargeImgPath(table.Rows(0)("ImageName").ToString())

        linkLargeImage.Attributes.Remove("onclick")

    End Sub

 

 

' COLOR ART CLICK SUB

    Private Sub imgColorart_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles imgColorart.Click

        CategoryID = imgColorart.CommandArgument

        CurrentPage = 0

        BindImages(imgColorart.CommandArgument, True)

        imgPicture1.ImageUrl = "~/images/Portfolio/Medium/" & table.Rows(0)("ImageName").ToString()

        lblTitle.Text = table.Rows(0)("Title").ToString()

        lblDescription.Text = table.Rows(0)("Description").ToString()

        linkLargeImage.HRef = PortfolioLogic.Image.GetAppLargeImgPath(table.Rows(0)("ImageName").ToString())

        linkLargeImage.Attributes.Remove("onclick")

    End Sub

 

 

' BLACK AND WHITE CLICK SUB.

 

    Private Sub imgBw_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles imgBw.Click

        CategoryID = imgBw.CommandArgument

        CurrentPage = 0

        BindImages(imgBw.CommandArgument, True)

        imgPicture1.ImageUrl = "~/images/Portfolio/Medium/" & table.Rows(0)("ImageName").ToString()

        lblTitle.Text = table.Rows(0)("Title").ToString()

        lblDescription.Text = table.Rows(0)("Description").ToString()

        linkLargeImage.HRef = PortfolioLogic.Image.GetAppLargeImgPath(table.Rows(0)("ImageName").ToString())

        linkLargeImage.Attributes.Remove("onclick")

 

    End Sub

 

 

  

 

 

End Class

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

CHAPTER 5: SCREEN SHOTS:

 

 

 

This is the home page. www.mxcdesign.com

 

You could see the background of this web site is not unique. The different images are created and stored at particular allocations using tables into it.

The design pattern is unique in all the browsers including safari in iMac.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Page 2. portfoliogallery.aspx

Displays the four categories : Interiors, Furniture, Color art and B&W art.

The arrow on left indicates the paging.

There are 5 images in the datalist per page.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

CHAPTER 6:  STAGGING ON DEVELOPMENT AND LIVE SERVER.

 

    1. setting up the IIS.
    2. copying the datatables, stored procedure, relations and everything into dev and live server.
    3. copying the project files into the folder in dev and live servers.
    4. copying dll filesafter debugging the solution.
    5. setting up the users authentication and access into web.config file.

Note: if you have just modified the aspx filed, you just need to copy the files onto live servers. However, if you made some changes intp class files or .vb or .cs files, than you have to compile the project and than copying the dll file from bin directory of your local drive to bin directory of live server.

Also do not forget to copy the new stored procedure, updated tables into the live database server.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

CHATER 7: TESTING

 

The testing phase is crucial in the development of web application. This chapter is dealing with different types of testing methods that should be applied in the development and testing stages of the web development life cycle.

 

NunitAPP – Automatic testing tool

NUnitAsp is a tool for automatically testing ASP.NET web pages. It's an extension to NUnit, a tool for test-driven development in .NET.

Once you have an automated suite of tests, you'll never go back. It gives you incredible confidence in your code. That confidence allows you to code much faster, because you can make risky changes secure in the knowledge that your tests will catch any mistakes.

NUnitAsp is for unit testing ASP.NET code-behind only. It's meant for programmers, not QA teams, and it's not very good for QA-style acceptance tests. It only tests server-side logic. JavaScript and other client-side code is ignored. But if you're using ASP.NET, it's an essential part of your programmers' toolset.

NUnitAsp is freely available under the MIT license.

NUnitAsp is a class library for use within your NUnit tests. It provides NUnit with the ability to download, parse, and manipulate ASP.NET web pages.

With NUnitASP, your tests don't need to know how ASP.NET renders controls into HTML. Instead, you can rely on the NUnitASP library to do this for you, keeping your test code simple and clean. For example, your tests don't need to know that a DataGrid control renders as an HTML table. You can rely on NUnitASP to handle the details. This gives you the freedom to focus on functionality questions, like whether the DataGrid holds the expected values.

Simply speaking, NUnitAsp makes it very easy to unit test ASP.NET web pages.

[Test]
public void TestExample()
{
   
// First, instantiate "Tester" objects:
   LabelTester label =
new LabelTester("textLabel", CurrentWebForm);
   LinkButtonTester link =
new LinkButtonTester("linkButton", CurrentWebForm);

   
// Second, visit the page being tested:
   Browser.GetPage("http://localhost/example/example.aspx");

   
// Third, use tester objects to test the page:
   AssertEquals("Not clicked.", label.Text);
   link.Click();
   AssertEquals("Clicked once.", label.Text);
   link.Click();
   AssertEquals("Clicked twice.", label.Text);
}

NUnitAsp can test complex web sites involving multiple pages and nested controls. The common ASP.NET controls are supported (see complete list below), and support for additional controls is easy to add.

 

 

Manual Testing involves :

 

Three test cases you should go through in unit testing

Positive test cases (correct data, correct output),

negative test cases (broken or missing data, proper handling),

Exception test cases (exceptions are thrown and caught properly).

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

CHAPTER 8 :  IMPLEMENTATION:

 

Once the website is on live, the implementation for this special web application is very simple. Just need to educate the client with the simple navigation system. By providing either a site map or a help documentary.

 

 

 

 

 

 

 

 

 

 

 

CHAPTER 9: CONCLUSION

 

The Project “ MXC Design website” was completed successfully And has been designed using the latest  .NET technologies. It will be very useful for art lovers and interior decorators.

I am glad that I helped Matthew to fulfill his requirements and make him popular to the world.

 

Future Enhancement:

If MXC comes up with more portfolio categories or more requirements, I will be glad to implement the project.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

BIBLIOGRAPHY: