ASP/ASP.NET
ASP.NET Questions and Answers part2

Q. List the features od ISA Server or Internet Security and Acceleration Server 2000>?

A.

1-Ability to schedule the download of contents.

2-Ability to create and enforece Internet usage policies.

3.Integrated instrusion detection.

4.Integrated logging and reporting functionality

Q. List the features of Application Center 2000

A.

1-One-click rollout of new servers

2-Simply server cluster creation and Management.

3-Automatic failover and server health monitoring.

4-Dynamic response to health monitoring.

Q. What is Notepad.NET?

A. One of the tool which used for developing .NET applications.

Q. What are all the features of Visual Studio.NET?

A.

1-Strong support for XML

2-Web Services

3-Dynamic Help

4-Drag drop development

5-A single, unified programming model for all .Net languages and for both Windows and Web Applications.

Q.What are all the data types that are not supported by CLS?

A.SByte, unit, ulong, ushort.   All these data types are available in C#.

Q Differentiate Value Types with Reference Types.

A.

Value Types

1)These data types store their data directly as value in momory.  Includes: Numeric Types (int32, short, single).   Structures(Custom data types based on System.ValueTypes).  Enumerations(Custom types that represent a defined set of values).  Boolean, char.

2) Can be accessed directlu

Reference Types

These data store types shows reference to another memory location that contains the data includes:

1.Object

2.String

3.Arrays

Can be accessed through the members of the class.

Q.Define Boxing.

A. Boxing is the process of creating an istance of the reference type of object and assigning the value of a value type to the object as well as storing information on the value's data type.

Q.Define UnBoxing.

A. Boxing is the process of assigning the value of the boxed object type to a variable of the appropriate type.

Q. What are all of the types of data types available in ASP.NET?

A.

1.Framework Specific data type.

2.Language specific data type.

Q. Define Naming Convension.

A. Naming Convension are simply agreed-upon standards for how elements will be named in the program.

Q.Define Lifetime.

A. Lifetime refers to the span of time from when the variable is declared to when it is detroyed.

Q.Define Scope.

A. Scope refers to the region of code in which a variable maybe accessed.

Q.What are different level of Scoping?

A.

Block Level: Variables declared within an If...Then, For...Next, Do...Loop Block

Procedure-Level: Variables declared within the procedures.

Module Level: Variables declared outside a procedure.

NameSpace-Level: Variables declared outside of a procedure, but given public accessibility(PUblic or Friends)

Q.Differentiate the Lifetime with Scope.

A. A variable maybe out of scope without having reached the end of its lifetime.

Q.Differentiate the terms Public, Friend, Protected, Private.

A.

Public

1.Declared with Public keyword

2.Accessible from anywhere in the same module.

Friends

1.Declared with the Friend keyword.

2.Accesible from anywhere in the same module as well as the namespace containingf the same module.

Protected

1.Declared with the Protected keyword.

2.Accesible only within the class in which they're declared or a class that inherits from that class.

Private

1.Declared with the Pirvate keyword.

2.Assesible from the Module, class, or structures in which they're declared.

3,Private keyword canot be used within the procedure.

Q. Differentiate Option Explicit with Option Stric.

A.Using Option Explicit will raise the sysntax error if we attempt to use variable before declaring it.

Using Option Strict will raise the syntax error if we attempt an implicit data type convention that would result in a loss of data.  Option Stict inplicity inclues Option Explicit.

Q.Where we've to use the Constants?

A. Constants are very useful when we have a literal value that we want to refer to by name.

Constants are very useful in place of literal values used as the arguments to the methods of component we may use.

Q.Differentiate the types of Procedures available in VB.Net

A.

Sub Procedures:  A Sub procedure executes code but dooesn't return a value.

Function Procedures:  Just like sub procedure, but they can return a value.

Q.Differentiate the terms ByVal and ByRef.

A.

ByVal: A copy of the value is passed to the procedure.

ByRef: A reference to the location of the value is passed to the procedure, which allows the procedure to modify the original value.

Q. In VB, While we are using ByVal and ByRef, which is the defail one?

A. ByRef.

Q. In VB.NET, while we are using ByVal and ByRef, which is the default one?

A. ByVal.

Q. How can you make the parameters of your procedure Optional?

A. By preceding the parameters with the option keyword, we can make the parameters of our procedure optional.

Q.What is the difference between using While and Until Loops?

A.

While will loops as long at its test condition evaluates to true.

Until will loopd as long as its test condition evaluates to false.

 

Please see ASP.NET Questions and Answers part3 because they are getting very interest,  and don't forget check out my personal website: http://m.aatechsources.com Article and Forum

 

 

 

 

 

 

 

 

 

 

ASP.NET Questions and Answers part1

Q. What are all the technology areas that Microsoft.Net contains?

Ans:

1.  .NET Frame Work

2.  . Net Enterprise Servers

3.  . Net Languages and Languages Tools.

 

Q. What are all the parts of .Net Framework?

Ans:

1.  Common Language Runtime

2. Net FrameWork Class Library

Q. What is CLR?

Ans:  The Common Language Runntime provides a runtime environment for the execution of code written in .Net Languages.

Q. What is CLS?

Ans: The Common Language Specification describes a subset of the data types supported by the runtime that are common to all of the languages used in .Net.

Q. What is IL or MSIL?

Ans:  The low level language compiled by the CLR is known as Intermediate Language or Microsoft Intermediate Language.  The individual language compiler compile the code written by developers into an Intermediate Language called Microsoft Intermediate Language.   This IL is then compiled to native code by the runtime at install or compiled time by Just-In--Time (JIT) at first execution.

Q.  Define Managed Code.

Ans: Code that is compiled to IL and managed by the runtime is reffered to as Managed Code.

Q. Define Assemblies.

Ans:  Component written in managed code and executed by the runtime are reffered to .Net managed assemblies or assemblies.

Q. What is the different between the COM and Assembly?

Ans:  COM component contains an associated type library to describe how clients should interact with it.   An assembly contains manifest, which is the set of metadata that describes the contents of assembly.

Q.  Define Manifest.

Ans:  Manifest is the set of metadata that describes the contents of the assembly.

Q. Define Metadata.

Ans:  Metadata describes the dependencies an version information associated with an assembly.

Q.  Define DLL.Hell.

Ans:  Version conflicts of the COM components are referred to as DLL.Hell.

Q.  Define Namspace.

Ans:  The namspaces are know as containers which will be used to organize the hierachical set of .NET Classes.

Q.  Define Page Class.

Ans:  Page class is the part od system.Web.UI namespace from which all ASP.NET pages are derived.

Q.  Define Inheritance.

Ans:  Inheritance is deriving the new class from already existing one.

Q.  What are all the .Net Enterprise Servers included in the .Net Framework?

Ans: 

1.  SQL Server 2000

2.  Exchange 2000 Server

3.  Commerce Server 2000

4.  Host Intergation Server 2000

5.  BizTalk Server 2000

6.  ISA Server or Internet Security and Acceleration Server 2000

7.  Application Center 2000

Q.  List all of the features of SQL Server 2000.

Ans:

1.  Input and output of data of XML.

2.  Side-by-side operation with SQL Server 7.0

3.  Multiple SQL Server instances on a single machine

4.  Intergrated OLAP engine.

5.  World Class scalability.

Q.  List of the features of Exchange 2000 Server.

Ans:

1.  XML Web store.

2.  Intergrated with the Active Dictionary.

3.  Out-of-the-box functionality.

Q.  List the features of Commerce 2000 Server.

Ans:

1.  Business Internet Analytics.

2.  Improved catalog Management.

3.  Powerful user registration and profiling system.

4.  Very useful to develope B2Z e-commerce site.

Q.  Tell me about the Host Intergration Server 2000.

Ans:  It allows COM Based access to programmatic functionality on legacy systems.

Q. List the features of Biztalk Server 2000.

Ans: 

1.  XML Based document transformation

2.  Document routing and tracking

3.  Business process orchestration

Please see ASP.NET Questions and Answers part2,  and don't forget check out my personal website: http://m.aatechsources.com Article and Forum

 

 

 

 

 

Latest developments in the .NET Hot Links



Use ASP.NET and Skype Simultaneously (CIOL)
You may get errors while using ASP.NET Web Applications and Skype Simultaneously. You may encounter this type of problem after installing Skype in your system.

Mainsoft Extends ASP.Net Across J2EE to WebSphere (Linux World)
Mainsoft is partnering two IBM Premier Business Partners: The TamGroup, specializing in the integration, management, and delivery of information via Portals, and with Prolifics, a provider of WebSphere, Portal, SOA, and Business Integration solutions. The IBM business partners can recompile ASP.NET applications into Java portlets on a fixed-time, fixed-cost basis, typically at a rate of 5,000

Mainsoft brings .NET to WebSphere Portal (ZDNet UK)
Builder : Visual MainWin for J2EE, Portal Edition allows developers to take existing ASP.NET Web applications and recompile them to run on IBM's WebSphere Portal



Access Control List in .NET Framework

Once you complete developing a web application, you need to secure it. This is when the aspect of security comes into picture...

About ASP.NET Assemblies in .Net
An assembly in ASP.NET is a collection of single-file or multiple files. The assembly that has more than one file contains either a dynamic link library...

CLR and its functionalities
Common Language Runtime (CLR) is the engine available in .Net Framework to compile and run the program. CLR engine does not compile the code...

Understanding Globalization in .NET
Globalization is a process of designing and developing software in such a way that it can be used in multiple locales with some minimal modifications...

Understanding ASP.NET HTML Server Controls
ASP.NET HTML Server Controls are the HTML controls that run at the server-side i.e. they have runat=”server” attribute...

Understanding Partial Classes in VS.NET
Partial class is a new functionality that is included in Visual Studio .Net 2005 and is supported in ASP.Net 2.0. This new functionality helps you to split a single...

About Web Forms in .NET Framework

Web pages in ASP.Net are called ASP.NET Web Forms which have certain server controls such as text, dropdown list, checkboxes, and buttons...

ASP.NET Web Server Controls

ASP.NET Web Server Controls are controls that run at the web server. All ASP.NET Web Server Controls can be identified by their attribute...

Understanding Web Services
Web services is a broad term that represents the technology to transmit data over Internet or Intranet. This data can be accessed programmatically...


Understanding WSDL and UDDI
Web Services Description Language (WSDL) is one of the prime specifications in web services, the other two being SOAP and UDDI...

Custom Server Controls in ASP.NET
ASP.NET offers many server controls for the developers to create web applications. However, at some point of development time when the developer does..

Understanding Repeater Controls in ASP.NET

ASP.NET Repeater Control is one of the control in List control, the other two being DataList control and DataGrid control. List control is extensively...

Getting Started with ASP.NET Web Matrix
ASP.NET Web Matrix is a development tool by Microsoft to create sophisticated web applications. Visual Studio.Net, another development tool, has lots of features...

Introducing Really Simple Syndication in ASP.NET
Really Simple Syndication (RSS) is an XML standard for declaring content entries for small content feeds. The RSS format has gained popularity...

Getting Started with Visual Studio.Net
Visual Studio.Net is a comprehensive Integrated Development Environment (IDE) that is extensively used to develop ASP.Net web applications...

Getting Started with ASP.NET Classes
The class is an object-oriented programming term to refer to a data structure that describes an object or a data member. The .Net Framework ...

Migrating from ASP to ASP.NET
ASP to ASP.NET migration can be done by just changing the extension from .asp to .aspx. But before transporting or migrate ...

Understanding Caching in ASP.Net
Caching is a feature in ASP.Net that is very useful in creating dynamic web pages. You know that dynamic web pages...

Simple country list dropdown component
You could have visited a lot of websites and filled out many forms in which you would have entered the country you...

Creating Multi-lingual Websites
With the advent of .Net creating multi-lingual websites has become easy. Earlier you need to create pages for each language...

Creating Simple Chat application in .Net
Chat applications are found in almost all the sites that are interactive with the users. Chat rooms in the websites provide a means of communicating...

FileSystemWatcher class in .Net
FileSystemWatcher class provided in .Net is used for monitoring the activities in a folder or sub-folders. You can watch the folder for specific...

Saving an Image in a SQL Server Database
Most of the web applications have a lot of images used in it. These images are usually stored in a web server folder and they are accessed...

How to Track Emails
It is very easy to track whether the user has read the email. The concept is very simple. You insert a link to a small transparent...

Understanding Cryptography Classes
Cryptography is a way to encrypt and decrypt data. By encrypting data you are protecting your data from other curious...

Understanding Graphic Design Interface GDI+ in .Net
GDI stands for Graphic Device Interface and GDI+ is a higher level interface of GDI. GDI+ is an easy to use version of GDI...

Server.Transfer - Access form values of one page in another page
Passing values in the form to another page is a frequently used and the most common task that is done in the web applications and intranet applications...

Calling External Applications Within .NET
Calling an external application from your .Net application is frequently done if you are developing a product. During the installation of a product you might require...

How to create a guest book in ASP.Net?
A guest book for a website is a very important feature to know the feedback of the users who are using the website...

How to create RSS feeds for your site in .Net?
Really Simple Syndication (RSS) is a simple way of sharing information on the web. RSS has become popular to share information from any website...

How to use adrotator control in ASP.Net?
An adrotator control is available in ASP.Net to ease the task of rotating the advertisement images in a web form...

Code Behind in .Net Framework
The ASP.NET Code Behind feature in .Net Framework allows developers to separate the server-side code from the presentation layer...

Common Type System in .Net Framework
As .Net Framework is language independent and support over 20 different programming languages, many programmers...

.Net Vs J2EE
When Microsoft launched .Net, IT arena was flooded with questions and debates as to which technology is superior to other. The .Net vs. J2EE debate ...

Pros and Cons of .Net and Java
.Net and Java are said to be the two widely used development environment to build web applications. It is very difficult to predict ...

Code and Performance Analysis using Visual Studio 2005 System
A set of tools for code and performance analysis is essential for the developers if they need to develop reliable and robust software

Creating an application to transfer files using Infrared Communication in Compact Framework
Connectivity between smart devices and the personal computers are the necessity in this fast moving world

Creating Multithreaded Application Using the .NET Compact Framework 2.0
In .NET compact framework creating a thread is simply a matter of instantiating a class of type thread and passing a reference

Creating self-updating applications in .Net Compact Framework
Updates are necessary for every application as the new features are added periodically. Apart from that new bugs are fixed and new versions

Managing Projects using Visual Studio 2005 Team System
Managing the software projects is a tedious task. Quite often you can find gaps between the actual customer requirements and the work

New features in .Net Compact Framework 2.0
Many new features are incorporated in the .Net Compact Framework 2.0. They are aimed at improving the productivity of the developer

Publish Feature in Visual Studio 2005 for Web Application Projects
Visual Studio 2005 has features that can used to publish a website in a production server or a staging server

Visual Studio 2005 Team System
With the ever increasing complexity of the IT solutions that are given there is a need to build and maintain such solutions properly

New Visual Studio 2005 Tools for Office
The Visual Studio 2005 Tools for Office brings a host of new additional enhancements to the solutions that can be made

Performing Web Testing using Visual Studio 2005 Team System
The Visual Studio 2005 Team System enables Web Testing which makes it easy for testing your website without writing any code


Securing Web Services in .Net Framework
Web Services is the promising technology that allows enterprises to share and integrate applications across different platforms. Since anybody...

Session State Management in ASP.NET
ASP.NET Session State Management allows developers to automatically identify and categorizes all the requests coming from a single client ...

XML Schema Definition (XSD) Tool in .NET
The XML Schema Definition tool generates XML schema or common language runtime classes from XDR, XML, and XSD files, or from classes...

XML Serialization in .NET Framework
You can convert XML documents and streams to common language runtime objects and vice versa with the help of XML Serialization...

Global Assembly Cache (GAC)
A computer installed with the common language runtime has a machine-wide code cache known as Global Assembly Cache...

Working with Visual J#
Visual J# is a tool from Microsoft for developing web applications and web services in the .Net framework. This tool is aimed...

Microsoft Exchange Server
Microsoft Exchange Server, as the name denotes, is software that enables you to communicate with others across network...


XML Tools in VS.NET 2005
The new XML Editor of VS.NET 2005 allows you to edit XML files with full XML 1.0 syntax checking, support for Document Type Definitions (DTD), and full XML...

Web Parts in ASP.NET 2.0
Web Parts in ASP.Net 2.0 are used to customize the web applications. A web page is divided into different areas and each area could be a web part...

Windows Management Instrumentation - WMI
Windows Management Instrumentation (WMI) is a component of the Windows Operating System that is used to get information about your computer system...


Sending Emails Using ASP.Net
Almost all the websites in the internet will be having features to send emails to someone. Most of the feedback sent to the Administrator of the website...

Role Based Forms Authentication in ASP.Net
Becoming a member of site alone will not entitle the user to access all the resources of a website. Different types of users are allowed to access...

Prevent Automated Website Registrations
While you register with a website to become a member of that site you would have noted that you are asked to enter the text that is displayed...

ConfigurationManager Class in ASP.Net 2.0
Some of the values and strings are used across all the pages of a website. It is a tedious process to code those values and strings in each page of the website...

Web.Config Editor 2.0
Web.config files are found in the root directory of a web application and other sub directories of the web applications...

Themes & usersitemap in ASP.NET 2.0

 

maisicon_1.GIF

 

I created http://makesdatawork.net on Themes (skin & css files) in ASP.NET 2.0.  Still trying to decide when it's best to use skin files over css files.  Already figured out that an object property should not belong to both.  Tested some, and haven't been able to receive consistent results.  Is it because...

Caching - How does the ASP.NET Developer server work?
When using multiple CSS / skin file- Are they always applied in the same sequence
Who knows????

I seem to experience the most inconsistencies when changing the document.Theme or document.StyleSheetTheme properties AFTER I have started using them, i.e. switching back and forth between document.Theme and document.StyleSheetTheme to test the differences between the two properties, I have noticed that the @Page directive was not always updated to reflect changes made in Design View.  Not sure what's going on there - need to do some more testing with a better attitude.

Design view displays form with skins applied when using document.StyleSheetTheme but NOT when using document.Theme

 

An Active Server Page is an HTML page

An Active Server Page is an HTML page that includes script code that is processed on a web server before the page is sent to the user. In most systems, the HTML (which is always stored on the server) is processed by script code that is also stored by the server using information received from the client browser. The server then builds the page 'on the fly' before sending it to the client. Since ASP just builds a regular HTML page, it can be delivered to any browser.

Here's the essentials of that processing.

1 - A browser sends a request for an ASP page rather than a normal HTML web page.

2 - The server finds the ASP page and runs the ASP code in the page.

3 - After the code runs, the server returns standard HTML back to the browser.

ASP works by doing the heavy lifting on the web server. For example, suppose you want to send a customized calendar (maybe with the latest sales events at your business marked in) to visitors at your page. You can pull the latest information out of a database, combine it with a information from the browser, build a calendar "on the fly" in HTML, and send it back to the browser. The magic part is that you can create the HTML returned to the browser from databases, ActiveX components, Visual Basic …. anything your programming skill can invent!

Let's look at a complete ASP page. The idea is to display a different quote every time someone accesses the page. In most cases, this would probably be done with a database, but if your needs are modest, you can get the same result with a simple VBScript 'CASE' statement.

Note that the script starts the same way that a normal HTML web page would. , , . So far, everything's pretty normal. Then you get this strange
"<%=date%>"
thingy. That's an ASP statement. The server converts that into the server date and plugs it into the same spot in the HTML.

     

Understanding Impersonation in ASP.NET

At times users access a resource as though they were someone else. This is known as impersonation. For example, if a web page has no access controls, then any user can access that web page. HTML pages, ASP pages, and components in version 3.0 and earlier can be accessed through two accounts named IUSR_machinename and IWAM_machinename. Both the accounts are set up during IIS installation, and are automatically added to all the folders in every web site on the server.

Anonymous access to a resource in IIS makes the task of identifying a user extremely difficult. But there is no need to authenticate a user in the case of IIS. When IIS receives a request for a web page or other resource that has permission for anonymous access, IIS treats the IUSR_machinename account as the user's account, to access the resources. If the resource requested by the user is an ASP page that uses a COM or COM+ component, that component is executed using the IWAM_machinename account.

In ASP.NET, when impersonation is turned off, the resources can be accessed using a "local system process" account. When impersonation is turned on, ASP.NET executes every resource using the account of a specified user who is authenticated when the user makes the request. If you specify the IUSR_machinename account to be used as the user account, then ASP.NET will behave like previous versions of ASP, in providing access to the resources.

In ASP.NET, you first need to check whether the application is configured to use impersonation. In the case of IIS, the IIS impersonates users with its own IUSR account. In the case of ASP.NET, impersonation is used to decide whether the user's request should be executed using the account of the requested user, or that of a local system-process account that ASP.NET uses for anonymous requests.

The concept of impersonation is complex to some extent due to the fact that ASP.NET uses the dynamic compilation features of the .NET Framework. The IUSR account has only limited permissions on the local machine, and so is not suitable without some reconfiguration. This account is also used by IIS to access resources like HTML pages, documents, and zip files that are not executed as part of the .NET Framework.

If impersonation is enabled in an ASP.NET application then:
• If anonymous access is enabled in IIS, the request is made using the IUSR_machinename account.
• If anonymous access is disabled in IIS, the request is made using the account of the authenticated user.
• In either case, permissions for the account are checked in the Windows Access Control List (ACL) for the resource(s) that a user requests, and a resource is only available if the account they are running under is valid for that resource.

If impersonation is disabled in an ASP.NET application then:
• If anonymous access is enabled in IIS, the request is made using the system-level process account.
• If anonymous access is disabled in IIS, the request is made using the account of the authenticated user.
• In either case, permissions for the account are checked in the Windows ACL for the resource(s) that a user requests, and a resource is only available if the account they are running under is valid for that resource.

 


 


Understanding ASP.NET Web Server Controls

ASP.NET Web Server Controls are controls that run at the web server. All ASP.NET Web Server Controls can be identified by their attribute ‘runat=”server”’. ASP.NET Web Server Controls are similar to HTML controls. The only difference is that HTML controls run at the client-side and the developers have to write the code for each type of browsers. The ASP.NET Web Server Controls run at the server-side and automatically adapt to the type of browser that request it.

ASP.NET Web Server Controls also encapsulates and generates large amount of HTML tags, thereby allowing the developers time to concentrate on coding. ASP.NET Web Server Controls makes exhaustive use of ViewState management. This makes data and values to be consistent across ASP.NET pages.

All web controls are obtained from a common base class. This ensures that the object model remains consistent across various controls. For example, in order to move the cursor consistently across a form you can specify the Web control TabIndex property. This is very difficult while using normal HTML. You can also disable a particular web control by exposing the Enabled property. This process is also difficult in HTML and ASP.

ASP.NET ASP.NET Web Server Controls consists of Web form controls, List controls, and Rich controls. All the web form controls are defined within the namespace System.Web.UI.WebControls. This namespace is a collection of classes that enables you to create new ASP.NET Web Server Controls. The controls that you can use web form controls category are button control, checkbox control, radiobutton control, table control, image control, label control, and panel control. These web form controls have a common set of properties that can be used across multiple controls.

The controls listed in the List controls category are dropdown list control, repeater control, datalist control, and datagrid control. These controls use the concept of data binding. The controls listed in the Rich controls category include calendar control and adrotator control. These controls are specifically being employed for complex tasks.

 


 

Understanding ASP.NET Validation Controls

After you create a web form, you should make sure that mandatory fields of the form elements such as login name and password are not left blank; data inserted is correct and is within the specified range. Validation is the method of scrutinizing that the user has entered the correct values in input fields. In HTML you can perform validation either by checking the values at client-side or after submitting the form at the server-side. But these methods in HTML take lots of time to create and maintain the code. Moreover, if the user has disabled JavaScript then he or she may not receive the message regarding the error.

Therefore, in ASP.NET you can use ASP.NET Validation Controls while creating the form and specify what ASP.NET Validation Controls you want to use and to which server control you want bind this. ASP.NET Validation Controls are derived from a common base class and share a common set of properties and methods. You just have to drag and drop the ASP.NET Validation Control in the web form and write one line of code to describe its functionality.

This reduces the developer time from writing JavaScript for each type of validation. Moreover, through ASP.NET Validation Controls if any invalid data is entered the browser itself detects the error on the client side and displays the error without requesting the server. This is another advantage because it reduces the server load.

The five types of ASP.NET Validation Controls in ASP.NET Framework include:

• RequiredField Validation control: prompts message if any input field is left blank. This validation control can also be used to prompt message to the user if he or she has left any input field with its default value.

• Range Validation control: Prompts message to the user, if the data entered in the input field is not within the range of the values specified by the Maximum and Minimum properties of the validation control.

• Comparison Validation control: Allows the user to compare two values and check for comparisons such as equality, greater-than, less-than etc. In addition you can check whether the data entered in the input field is of the data type as specified by you.

• RegularExpression Validation control: Allows you to validate if the format of a certain input field is correct or not. You can check the validation of the commonly performed formats such as social security numbers, e-mail addresses, telephone numbers, and postal code.

• Custom Validation control: Allows you to define your own condition for validating the data in the input fields. Two validation functions can be performed using Custom Validation control: first on the server-side and second on the client-side. These functions contain logic defined by you to validate the input fields. These functions returns the True value and False value, if the condition you specified is correct or not respectively.

If the control’s value does not validate to what you have specified in the validation control tag, the web form displays an error message. Moreover, you can customize the format of the error message by using the control properties such as BackColor, BorderStyle, and BorderWidth. In addition, you can use Cascading Style Sheet (CSS) to format an error message.

Access Control List in .NET Framework

Once you complete developing a web application, you need to secure it. This is when the aspect of security comes into picture. There will be some portions of your application which need to be secured from users. Securing an application may need extra hardware to build complex multi-layer systems with firewalls, and also some highly secure features. Security enables you to provide access to a specified user after the user is authenticated and authorized to access the resources in your web application. The Access Control List is used in the authorization process.

The basic concepts of security are Authentication, Authorization, Impersonation and Data or functional security. Authentication is the process that enables to identify a user, so that only that user is provided access to the resources. Authorization is the process that enables to determine whether a particular user can be given access to the resources that the user requests. Impersonation is the process that provides access to resources requested by a user under a different identity. Data or functional security is the process of securing a system physically, updating the operating system and using robust software.

Some elements of an operating system, the Internet Information Server (IIS), and the .NET Framework work in coordination to provide the features required to execute the security concepts mentioned above. For example, Windows 2000 uses its own list of user accounts for identifying and authenticating users. IIS identifies the users based on the information provided by Windows, when the users access a web site. IIS after identification of the users, passes this information to ASP.NET. Then the user information is checked for authorization.

To restrict access to the users for certain resources of an application, a process of identifying the users becomes a necessity. Authentication enables to restrict a user to access the resources by certain ways. It could be a combination of a username and password, a digital certificate, a smart card or a fingerprint reader. The validity of the information provided by the user helps identify the user, so that the user is provided access to the requested resources. The process of successful identification of the user implies that the user is authenticated.

After identification of the user is over, the next step is to determine whether the authenticated user has access to the resources. The process of determining the access to the resources for a particular user is known as Authorization. In Windows based systems, resources have an Access Control List, which provides a list of users who have access to that resource. The list also specifies the kind of access such as read, write, modify, and delete the resource, for each user. For example, if a user requests an ASP page, the operating system checks whether the user has Read access to the page and if the user has read permission, then the operating system allows the IIS to fetch the page. The IIS has authorization settings which enable the IIS to control the access of resources by users. File Access Control Lists are set for a given file or directory using the Security tab in the Explorer property page.

 

 


Introduction to .NET Framework

Net Framework is a platform or development environment to seamlessly create web-applications that are accessible through client machines from across the globe. These web-applications adopt open standards such as eXtensible Markup Language (XML), HyperText Transfer Protocol (HTTP), and Simple Object Access Protocol (SOAP) to interact with applications that are available in other platforms.

Net Framework is platform independent and language independent. This means that .Net Framework allows you to use different programming languages such as VB.Net, C#, Jscript, VBScript, and Managed C++ and run applications on different platforms such as Unix, Macintosh, and Linux. Moreover, .Net Framework enables you to use various off-the-shelf libraries that help the development of applications faster, easier, and cheaper. .Net Framework now supports over 20 different programming languages.

The reason how .Net Framework supports so many programming languages is well answered by the concept of Common Language Runtime (CLR) engine. The CLR engine, instead of compiling the code into native code, compiles the code into Microsoft Intermediate Language (MSIL). The MSIL, a set of instructions, then translates the code into native code. This concept of CLR is significant in making .Net Framework, platform and language independent. In addition, CLR is responsible for run-time services such as language integration, security enforcement, memory process, and thread management. Thus, .Net Framework provides a wide infrastructure to create web-applications. Microsoft has classified .Net Framework into two categories such as CLR and .Net Framework class library.

Common Language Runtime: The CLR, as mentioned in the above paragraph, provides common runtime services to all .Net applications. In addition, the CLR reduces the developer’s time to write lengthy code for using features such as life-cycle management, strong type naming, cross-language exception handling, and dynamic binding to turn business logic into a reusable component.

.Net Framework class library: This class library includes predefined sets of functionality that developers can use in their own applications. The library consists of three key components:

• ASP.NET.
• Windows Forms.
• ADO.NET.

The .Net Framework provides a number of advantages such as fewer lines of code, complete compilation, ease of deployment, web settings and web.config, and caching. By fewer lines of code, we mean that .Net Framework allows developers to use Web controls, thereby spending more time in implementing application design and the general flow of application. Another important part of .Net Framework is that everything including Web controls, Web forms, and server-side blocks of code are compiled when a page is requested for compilation. Ease of deployment refers to the concept that components in .Net Framework can be compiled on your machine and then uploaded with all the pages in the /bin directory. Unlike a web-application in ASP, where pages have to be uploaded and the components of the pages have to be registered with the operating system, the components in a web-application in .Net Framework need not be registered.

Web settings means the configuration of .Net applications that can be accomplished through web.config, an XML based file. Because a web.config file is in XML, it is easy to understand and it is also programmatically modifiable. When a web.config file is modified the machine detects the changes immediately. This enables quick configuration of .Net applications. Caching is the term used to describe the process of collecting commonly accessed data into memory for quick retrieval. .Net Framework support three types of caching: output caching, data caching, and fragment caching.

 

About Web Forms in .NET Framework

Web pages in ASP.Net are called ASP.NET Web Forms which have certain server controls such as text, dropdown list, checkboxes, and buttons. An ASP.NET Web Form looks similar to the web forms in HTML. The only difference is that in ASP.NET, the Web Forms runs at the server side and in HTML the web forms runs at the client side. Apart from this difference an ASP.NET Web Form has more features than an ordinary HTML web form such as:

• The code blocks are processed on the server.
• The entire page in ASP.NET is compiled when it is requested for the first time. When you make subsequent requests, the page is not compiled but shown directly in your browser.
 ASP.NET Web Forms can contain page directives. Page directives allow you to set the default language and user controls tags for the entire page. You can also turn off session state and ViewState management using page directives.
• An ASP.NET Web Form can contain both user controls and Server side Includes (SSIs).
• An ASP.NET Web Form though run on the server can contain client side script such as JavaScript or Jscript.

An ASP.NET Web Form first gets compiled into Intermediate Language (IL) and later to the machine language. Not just the server-side code gets compiled but every control and element in the page gets compiled. This enables the ASP.NET Web Form to be in any language that is compatible with Common Language Runtime (CLR) engine. Another advantage with the code getting translated to IL is that the user can use the application in any browser. In addition, you can reduce the processors and server’s load when you compile the ASP.NET Web Forms in ASP.NET, thereby, increasing the user’s productivity time. Thus ASP.NET allows you to create Web Forms that are platform independent, language independent, and browser independent.

Understanding User Controls in .NET Framework

Though you can apply multiple server controls in your web form, ASP.NET allows you to create new controls according to your requirements. The controls that you create are called ASP.NET User Controls. ASP.NET User Controls have .ascx extension. The biggest advantage of ASP.NET User Controls is that it allows you to save a part of the web form and reuse it many other web forms. This drastically reduces the developers’ time.

ASP.NET User Controls are self-contained entities that are saved in an independent file. You can relate a user control with a “black box”. ASP.NET User Controls are very helpful when you want to use functionality on multiple pages of a web-application. For example, if you want to use a site navigation header or footer on all the pages of the web application, you can create this site navigation header or footer as a user control in a separate page. You do not need to place this user control on each and every page. You just have to write a few lines code to call the user control.

As ASP.NET User Controls are self-contained the developers working on the same project need not worry about transgressing on other’s code. ASP.NET User Controls offer a great deal of functionality than Server-side Includes (SSIs). Using SSIs in encapsulating the site functionality is a quite tedious task when compared to ASP.NET User Controls. You can create a user control by using the Register directive. This process is called registering the user control. For instance, you can use this code to register a user control:

<%@ Register TagPrefix="sampNamespace" TagName="Myname" Src="mypage.ascx" %>

The TagPrefix is the exclusive namespace provided to the user control so that multiple ASP.NET User Controls with similar name can be discriminated from each other. The TagName is the name of the user control and the Src is the virtual path to the user control. After registering the user control you can place the tag of the user control in an appropriate location on the web form. You have to include the runat=”server” attribute with the tag.

You can create a user control using only one programming language for a web form. However, you can create multiple ASP.NET User Controls for a web form. For example, you can create a user control using C# and another user control using VB.NET and use both the ASP.NET User Controls on the same web form.

About Just in time (JIT) compiler in .NET

The high level programming languages that need to be compiled require a runtime, so that the architecture on which the language runs is provided with details on how to execute its code. All the programming languages use its corresponding runtime to run the application. For example, to run an application developed using Visual Basic, the computer on which the application will be run must be installed with the Visual Basic runtime. The Visual Basic runtime can run only the applications developed with Visual Basic and not the ones developed with any other programming language like Java.

In the .NET Framework, all the Microsoft .NET languages use a common language runtime, which solves the problem of installing separate runtime for each of the programming languages. Microsoft .NET Common Language Runtime installed on a computer can run any language that is Microsoft .NET compatible.

The main advantage of the .NET Framework is the interoperability between different languages. As all the Microsoft .NET languages share the same common runtime language, they all work well together. For example, you can use an object written in C# from Visual Basic.NET. The same applies for all the other Microsoft .NET languages.

When you compile a Microsoft.NET language, the complier generates code written in the Microsoft Intermediate Language (MSIL). MSIL is a set of instructions that can quickly be translated into native code.

A Microsoft.NET application can be run only after the MSIL code is translated into native machine code. In .NET Framework, the intermediate language is complied "just in time" (JIT) into native code when the application or component is run instead of compiling the application at development time. The Microsoft.NET runtime consists of two JIT compilers. They are standard JIT compiler and the EconoJIT compiler. The EconoJIT compiler compiles faster than the standard JIT compiler, but the code it produces is not as optimized as the code obtained from the standard JIT compiler.

Understanding Globalization in .NET

Globalization is a process of designing and developing software in such a way that it can be used in multiple locales with some minimal modifications to the software. The software changes the locale-specific information, to provide information to the user based on the configured locale of the operating system.

Globalization involves two processes, internationalizing the application code and localizing the application to other languages and cultures. The internationalization process includes steps to translate, store, retrieve, and present application content for any locale, using the same application code base. A locale is a combination of both language and cultural environments, including the format of dates, times, currencies, telephone numbers, and so on.

The internationalization process of globalization enables to you to remove all content from the presentation layer and from the code base. Only a single code base and a single presentation layout will present content for any culture. This process also enables you to place the content in a location that can be easily translated and that will be programmatically accessible to populate the presentation layer. In addition, the internationalization process allows storing content and user input in a format that can be presented with integrity for the appropriate culture. The internationalization of the application makes the application ready for localization.

The localization process of globalization enables your application to adapt to other locales by translating and formatting content according to culture, without any change in the code. This process also enables removal of any bugs introduced by internationalization, such as accidentally translated file or field names.

The globalization process also includes culture information of the locale where the software will be used. The culture information is a combination of language and the location. Working with culture information requires namespaces. The namespaces available in .NET are System.Globalization, System.Resources and System.Threading.

The System.Globalization namespace contains classes that define culture-related information which includes language, country or region, calendars, the date format, currency, numbers, and the sort order for strings. These classes are useful for writing globalized (internationalized) applications. Classes like StringInfo and TextInfo provide advanced globalization functionalities, such as surrogate support and text element processing. The System.Resources namespace contains classes and interfaces that allow developers to create, store, and manage various culture-specific resources used in an application. The System.Threading namespace contains classes and interfaces that enable multithreaded programming. The classes of this namespace enable synchronization of thread activities and access to data.

 

 

Understanding WSDL and UDDI

Web Services Description Language (WSDL) is one of the prime specifications in web services, the other two being SOAP and UDDI. WSDL is the description language for web services that describes a set of SOAP messages and how these messages are exchanged across network. WSDL will be in XML format; therefore it can be easily understood and edited by humans and machines.

Another advantage of WSDL being in XML format is that it is programming-language independent and also platform independent. In addition, WSDL defines where the web service is available from and what communications protocol has been used to talk to the web service. As a result the WSDL file describes everything that is required to write a program for an XML Web service. There are tools available in Microsoft Visual Studio .NET to read a WSDL file and generate the code required to communicate with an XML Web service.

Universal Discovery Description Language (UDDI) is a directory where you can expose your web services for other users to easily access it. You can also consume the web service that is already posted in UDDI. However, you can also post a web service without registering it in UDDI. DISCO is another directory where you can post your web service. But if you want to reach to maximum of customers, you can place it in UDDI. The UDDI directory offers three parts for you to register:

• White Pages
• Yellow Pages
• Green Pages

The white pages consist of the description such as name and address of the company offering the service. The yellow pages consist of industrial categories based on standard taxonomies such as North American Industry Classification System and Standard Industrial Classification. The green pages describe the interface to the web service in detail so that anyone can write an application after using the web service. Web services are described in UDDI directory through a document called Type Model or tmodel. Normally, this tModel contains a WSDL file that describes a SOAP interface to an XML Web service, but the tModel is flexible enough to describe almost any kind of web service.

Apart from using the web services from UDDI, you can also search a particular web service in UDDI. In addition, you can search for companies’ information that posted web services. In certain times, you might know the names of the companies that offer web services but you may not be aware of the web services that they offer. The WS-Inspection is a specification in UDDI that allows you to search for a collection of web services that are located in a particular company name. You can evaluate these web services according to your requirements.

An assembly in ASP.NET III

This part of the article is going to be the last of the series. In the last part I introduced you to what the .NET Assemblies are and for what reasons are they used? You also were informed about the advantages of using the .NET Assemblies as compared to the other scripting techniques that we have available in the ASP .NET.

Before implementing an assembly I would like to add,  that we implement many pre-built assemblies while we are working on ASP .NET based applications. For example; the System namespace and other namespaces like it i.e. System.Data, System.Web are also pre-built assemblies that have been provided in the .NET framwork to us by Microsoft. In addition to this they have also provided us the capability of making our own assemblies. As compared to the classic ASP making components in form of assemblies in ASP .NET is much more easier and flexible.

Now let's go ahead with creating our first component. This is going to be a simple component that would just provide us with a few options to display a message on the screen. Write the following code in Notepad or any other editor that you have.

Imports System

Namespace HRM.Display
Public Class DisplayConsole

Public Function Welcome() As String
        Return "Welcome to your first component!"
End Function

Public Function Output(strParam As String) As String
        Return strParam
End Function

End Class
End Namespace

Save this file by the name "hrmDisplay.vb".

Now for the process of converting this file into a compiled DLL file, we require to make a batch file. Again open the Notepad and add the following to it. Save the following file by name "MakeComponent.bat"

set indir=c:\inetpub\wwwroot\hrmDisplay.vb
set outdir=c:\inetpub\wwwroot\bin\hrmDisplay.dll
set assemblies=System.dll
vbc /t:library /out:%outdir% %indir% /r:%assemblies%

Before running the file you require to create a directory by the name of bin. Create a directory in your current directory by name of bin and then run the file. Checkout the bin directory your DLL file would be placed there after its creation.

Before using the component we require to do one more thing! and that is to make a web.config file. Web.config is an XML based file that specifies important configuration for an ASP .NET application. Again open up the Notepad and write the following code.


 
   
   
       
         
       

   

 

Save this file as "web.config". The reason that we made the bin directory and then placed the DLL file within it was that the web.config would always search for the file in the bin directory, not only this assembly, but other user defined and third party assemblies also require there references to be added into the web.config.

Now we are ready to use our component within our ASP .NET page. Open up Notepad or any other editor and add the following code into the file and save it as "Test.aspx".

<%@ Import Namespace = "HRM.Display" %>
<%@ Page Language = "VB" %>

An assembly in ASP.NET II

ASP .NET introduces many techniques for better code management and code reusability. Code Behind and Custom Controls are one of the best implementations of these techniques where you can separate your HTML tags and coding from your server-side script. It also provides future  facilities to manage the code easily.

The Code Behind and Custom Controls development is a good approach to better web development, but there is a performance hit that also exists. You may know about the CLR (Common Language Runtime), I will not go into the detail of this, but just for a brief introduction, it is the "black box" or the "heart" of the .NET where the compilation of your code takes place. Whenever an ASP .NET page  is opened or requested by the user, the page gets compiled first and then is transferred to the user. The compilation process is also completed in two steps. First of all an IL (Intermediate Language) is generated and then this is handed over for JIT (Just In Time) compilation  which produces the machine code and our pages get displayed with their dynamic content.

The performance of our web application can be improved by creating pre-compiled libraries of IL which can then be handed over to JIT directly without having the inclusion of an extra process to make the conversion. This method is called componentization. Components are pre-compiled set of classes that have been developed in the form of DLL files and can then be included within our projects. This is also known as an assembly.

"An assembly is a logical grouping of functionality in a physical file."

Understanding the assemblies and their concepts is the focus of this article. An assembly has many benefits some of which are.

  1. Increased performance.

  2. Better code management and encapsulation.

  3. Introduces the n-tier concepts and business logic.

You might have heard of the n-tier and three-tier architecture concepts. (To know about the detail of 3-tier architectural concepts please read Part-I of this article.). The practical implementation of the three-tier architecture is also implemented by using the assemblies. In the first part of this article we discussed about the Business Logic layer. This layer is where we place all the business rules that apply to the transactions that take place between the client and the server, and this layer is implemented through components. The reason for this is that one we hide our code and the business rules that have been applied (since the components are in compiled binary form, so they are a mean of code encapsulation) and second because they are more efficient (since the code is already transferred into IL therefore only the JIT compilation takes place instead of both the IL and JIT).

An assembly in ASP.NET I

An assembly in ASP.NET is a collection of single-file or multiple files. The assembly that has more than one file contains either a dynamic link library (DLL) or an EXE file. The assembly also contains metadata that is known as assembly manifest. The assembly manifest contains data about the versioning requirements of the assembly, author name of the assembly, the security requirements that the assembly requires to run, and the various files that form part of the assembly.

  1. In the first part we will be discussing the 3-tier architecture.

  2. In part-II of this article we will see what the .NET assemblies are and

  3. In the last part we will be practically implementing a simple .NET assembly.

Part-I :: The Three-Tier Architecture

A 3-tier architecture defines the division of a web based application into three layers. When we say 3-tier architecture, we are actually meaning the number of nodes (or computers) that are involved within the communication. Let's first of all see what do I mean when I say a 3-tier architecture or a n-tier architecture.

For example, consider a simple scenario in which we have a client/server architecture. A user simply connects with the server and communication starts. The server fulfills all the requirements of the client as all of the contents have been placed on the server. This type of architecture is called as a client/server architecture or it can also be said as a two-tier architecture.

In a two-tier architecture the server contains all the contents that would be requested from the client, the contents can include web pages, the server-side technology implemented and the data-store. If we separate the contents of the server-side technology from the web pages and place them on a separate machine then this architecture would become a three-tier architecture. Similarly if we keep on increasing the number of machines in between our client/server communication then we would be implementing the n-tier architecture for our communication.

Why do we need the three-tier architecture?

The three-tier architecture was introduced for better management of code and contents and to improve the performance of the web based applications. Within the three-tier architecture we divide our application into a set of three layers.

  1. Presentation

  2. Business Logic

  3. Database

  • The first layer Presentation contains the interface code, that is going to be displayed to the user. This code could contain any technology that can be used on the client side like HTML, JavaScript or VBScript etc.

  • The second layer Business Logic contains all the code of the server-side technology. This layer mainly contains the code that is used for accessing the database and to query, manipulate, pass data to user interface and handle any input from the UI as well.

  • The third and last layer Data represents the data store like MS Access, SQL Server, an XML file, an Excel file or even a text file containing data.

The following diagram shows the layers we have just described.

The Three Tier Web Application Architecture

(Figure Displaying the layers of the three-tier architecture)

One of the main benefits of the three-tier architecture is easy management of the contents of the web application. Consider a scenario in which you require to change the presentation of the web pages because you have recently designed a new look for your website. In the case of two-tier architecture you would require to change the web pages that would be containing both the contents for the presentation as well as the business logic, this would mean an headache for you to keep the code for business logic as it is and change the code for the presentation layer. In case of a three-tier architecture the code of the business logic would be residing on the middle layer, there for you would be requiring only to make a change on the presentation layer containing the code for your web page designs.Similarly if you require to change the database system for example, from Access to Sql Server, then you would require only to change the database on the data server without having to make any changes within the code of your business logics.

The three-tier application design also enables for better performing web applications, since the whole load of users is not placed upon a single server. As we can see in the figure displaying the design of a three-tier architectured web application, it can be seen that placing the business logic and the database on the different machines reduces the load upon a single server. Similarly we can implement any number of servers we like on the backend of the application and such an architecture would be known as n-tier architecture.

The Global.asa file:

The Microsoft Visual InterDev manual explains the global.asa file as follows:

The Global file is an optional file in which you can specify event scripts and declare objects that have session or application scope. It is not a content file displayed to the users; instead it stores event information and objects used globally by the application. This file must be named Global.asa and must be stored in the root directory of the application. An application can only have one Global.asa file.

Global.asa files can contain only the following:

· Application events

· Session events

The Global.asa file:

<script language="vbscript" runat="server">
Sub Application_OnStart
Application("visitors")=0
End Sub
Sub Session_OnStart
Application.Lock
Application("visitors")=Application("visitors")+1
Application.UnLock
End Sub
Sub Session_OnEnd
Application.Lock
Application("visitors")=Application("visitors")-1
Application.UnLock
End Sub
</script>

a period of time or the web site being stopped.

To display the number of current visitors in an ASP file:<html>
<head>
</head>
<body>
<p>
There are <%response.write(Application("visitors"))%>
online now!
</p>
</body>
</html>
Features Examples From Mai

Click on  “Features Examples From Mai”.  line above.  I am hoping you enjoying my examples

 

.NET Articles

 Enjoy my Favors .NET Articles...they are very usefull for me...

 

ASP-Sources

Click “ASP-Sources”.  line above.  You are right on,  this is another of my favor ASP Sources Links...

 

ASP & HTML

undefined

When I first started building personal web sites for myself. At that time my tool of HTML development was MS FrontPage 2000, which didn't require knowing coding syntax for the most part. Later I learned HTML scripting in and out and used it in many commercial projects as well as other needs. This web site for instance has been built solely in plain HTML with lots of JavaScript and CSS.

In most cases I use manual coding as opposed to drag-n-drop features of such code editors as FrontPage and Dreamweaver for instance because it gives me unlimited control over the content. On the other hand I can still use tools to create such code-intensive objects as navigation bars, rollover images or embedded Flash movies which saves a lot of time and effort. Dreamweaver "Behaviors" pane as well as all other tools are very helpful in that manner. Working with HTML coding for so long helped me learn syntax and functional capabilities of this scripting language in full and enabled me creating attractive and rich web content with minimum time frame required.

While talking about my HTML skills I surely ought to mention CSS and JavaScript which unavoidably goes with it. Thus instead of using obsolete and inconvenient tag everywhere throughout my code, which would render possible following content updating extremely hard and painful as well as make my code require a lot more memory and load time, I use CSS to control the appearance of my pages. You will never find tag in any of my pages. Although I will talk in greater details about this in my other section called “CSS”  I still have to briefly touch on it here too.

While tag isn't as bad and redundant as and I use it frequently for some specific needs, I still try to stay away from it when targeting certain audience with known browsers. I use
layers instead, which allows for easier and greater control over the content positioning while making code more efficient and easy to follow. In this specific page for instance I used tables only for one reason: I drew the page's look in Fireworks and exported graphics together with HTML. Since Fireworks creates HTML tables to position objects on the screen, I could convert them into layers later with Dreamweaver (Modify-Convert-Tables to Layers), but decided not to do that. Table is ancient HTML object and supported equally well by any browser out there for sure. Preserving tables ensures correct page rendering on every platform and browser which I can't correctly predict in full in this particular case.