Вы находитесь на странице: 1из 7

Branch

Management

Stock
Head Management
Manager

Branch
Login Manager

Salesman
7.3.8 Code Inventory
Files in Asp.Net Application:

Main files on ASP.NET applications are as per below:

Files Purposes
.aspx Contain all web controls in flat or grid layout.
For designing the form.
.aspx.cs Code Behind File.
For C# code for event, functions, classes etc for .aspx file.
web.config Configuration setting for particular application.
It is written in XML file with special tags.
.js JavaScript file.
File may be class file, may contain functions etc
.master Master Page File
File that will provide the same layout for all pages of site.
.css Cascading Style Sheet.
Provides the same style for whole site’s controls by declaring once.
Global.asax Record of every event in the application & inaccessible to the user.
It resides in the root folder of the application.
.edmx An .edmx file is an XML file that defines a conceptual model, a
storage model, and the mapping between these models. An
.edmx file also contains information that is used by the
ADO.NET Entity Data Model Designer (Entity Designer) to
render a model graphically.

In ASP.NET we can do coding in the .cs file either in Visual Basic or Visual C# or
Visual J#. In this IMS (Inventory Management System) we have used Visual C# for coding in .cs
file. There is one more thing in code that is client side script that is the code that will be executed
in client machine. That script can be write in two scripting language either VBScript or
JavaScript. First of all some points regarding Client side scripting is explained here.

A script that is interpreted by the browser is called a client-side script. A client-side


script is also an instruction set, but it is not processed by the web server. Instead, it is sent to the
browser and is processed by the browser; the result is then displayed by the browser on the
computer. Client side script is most of use for the validation purposes.
Every Code behind (.cs) file is start with namespaces included for the application.
There are some basic namespaces uses for the ASP.NET applications are given below:

Namespace Used For


System For Declaration of general Variables
System. Data For Datasets, Data views
System.Data.OleDb For Databases other then SQL Server
System.Data.SqlClient For SQL Server Database
System. Collections For array lists, hash tables, sorted lists
System.Web.UI.WebControls For Declaration of Web Controls
System.Web.UI.HTMLControls For Declaration of HTMLControls
System.Web.Mail For E-Mail Applications

Master Page with Web User Control

There are two .ascx files that is called Web User Control. This provides the header &
footer user interface for Mater page (Master.master). This Master form facility is newly introduce
in Visual Studio 2005, It give the common interface to all forms which include the master page.
The code to include master page in any form is as below:

<%@ Page Language="C#" MasterPageFile="~/HeadManager.master"


AutoEventWireup="true" CodeFile="HeadManagerHome.aspx.cs"
Inherits="HeadManagerHome" Title="HeadManager" %>
This above code is the code of .html file. In the ‘Page’ tag the attribute MasterPageFile
is use to add the master page.

Java Script in Asp.Net

As we know the client side validation is perform too fast than server side validation.
JavaScript is use for Client side scripting in ASP.NET. I have also use this script for display
dialog boxes, blank TextBox check & DropDownList selected item check.

At the time of delete button click the following JavaScript will be execute. For that
we have to write code in both html interface file & code behind file.
In .cs file declare the like following:

btnDel.Attributes.Add("onclick", "return Conform();");


In html file function for conform will look like following:

function Conform()
{

var answer = confirm("Are you sure you want to delete?");


if(!answer)
{
return false;
}

return true;
}
This script will display dialog box with yes & no option. If we press yes then that

button click event will happens else if click no then event will cancel.

.EDMX File In Asp.Net


An .edmx file is an XML file that defines an Entity Data Model (EDM),
describes the target database schema, and defines the mapping between the
EDM and the database. An .edmx file also contains information that is used
by the ADO.NET Entity Data Model Designer (Entity Designer) to render a
model graphically. The recommended practice for creating an .edmx file is to
use the Entity Data Model Wizard.

Changes are made to an .edmx file when you use the Entity Designer to
modify your model and when you use the Update Model Wizard to update
your model based on changes to the underlying database. There are also
some scenarios in which you might have to edit an .edmx file manually.
Model1.EDMX FIle
Database Diagram

Вам также может понравиться