1. Active server pages .net role
>>1 shifting from Asp to Asp.net
>>2. Asp.net as a framework ,namespaces
>>3. Asp .net scenario for development with ide
>>4. Webpages to web forms
>>5. Html-asp.net state management,important objective
>>.6 Asp.net execution scenario
>>.7 C# .net role in ASP.net development
>>.8 Asp.net /C# industry approach
>>.9 HTML HTML controls ASP controls
>>.10 Client /server side controls
>>.11 Consuming ASP.net controls in web-forms
1 shifting from Asp to Asp.net
The ASP.NET makes the work easy for developers' to transition from Windows application
development to Web development by offering the ability to create pages composed of
controls similar to a Windows user interface.
ASP.NET gives courage or confidence to the programmer to develop applications using
an event-driven GUI, other than in conventional Web-scripting environments like ASP
and PHP. The framework joins together existing technologies such as JavaScript with
internal.
Differences with ASP classic are:
ASP is run under the inetinfo.exe process space it relates to the process isolation setting
in IIS. On the other hand ASP.Net worker process has so much different worker process,
aspnet_wp.exe, which is separate from IIS process.
Classic ASP had no mechanism of running itself on us like non-Microsoft platforms. But
ASP.NET will run on non-Microsoft Platforms
ASP only allows two languages were available for scripting VBScript and Jscript. But in
ASP.NET any fully compliant .NET language can be used.
In ASP you have to place all directives on the first line of a page within the
same delimiting block as shown below:
<%LANGUAGE="VBSCRIPT" CODEPAGE="932"%>
But in ASP.NET, you can require to place the language directive with a Page
directive shown below:
<%@Page Language="VB" CodePage="932"%> <%@QutputCache
Duration="60" VaryByParam="none" %>
2. Aspto web2.0
Web Forms are the heart and soul of ASP.NET. Web Forms are the User
Interface (UI) elements that give your Web applications their look and feel.
Web Forms are similar to Windows Forms in that they provide properties,
methods, and events for the controls that are placed onto them.
Web Forms are made up of two components: the visual portion (the ASPX file),
and the code behind the form, which resides in a separate class file.
Figure . Web Forms are a part of ASP.NET
Web Forms and ASP.NET were created to overcome some of the limitations of ASP.
These new strengths include:
Separation of HTML interface from application logic
A rich set of server-side controls that can detect the browser and send out
appropriate markup language such as HTML
Less code to write due to the data binding capabilities of the new server-side .NET
controls
Event-based programming model that is familiar to Microsoft Visual Basic®
programmers
Compiled code and support for multiple languages, as opposed to ASP which was
interpreted as Microsoft Visual Basic Scripting (VBScript) or Microsoft Jscript®
3. Allows third parties to create controls that provide additional functionality.
2. Asp.net as a framework ,namespaces
ASP.NET is an open-source server-side web application framework designed for web
development to produce dynamic web pages.
It was developed by Microsoft to allow programmers to build dynamic web sites, web
applications and web services.
ASP.NET's successor is ASP.NET Core. It is a re-implementation of ASP.NET as a modular
web framework, together with other frameworks like Entity Framework.
It was first released in January 2002 with version 1.0 of the .NET Framework, and is the
successor to Microsoft's Active Server Pages (ASP) technology.
A namespace provides a fundamental unit of logical code grouping.
A namespace can contain both other namespaces and types. The full name of a type
includes the combination of namespaces that contain that type.
Microsoft defines namespaces as "a logical naming scheme for grouping related types."
System is the root of the namespaces. Within each namespace we can find anywhere
from one to several other sub-namespaces that provide programmers with the
functionality needed to create and provide Web-based applications.
System.Web is a great example
Figure . A namespace and class hierarchy
3>> Asp .net scenario for development with IDE
To develop ASP.NET applications, you must have the following:
* The .NET Framework 4.7.
4. * A code-authoring environment.
* A Web server, such as Internet Information Services (IIS), and permissions to write files
to the Web server.
* Optionally, you can use the following:
* A database product, such as Microsoft SQL Server, to provide application data storage.
* An SMTP server to send e-mail messages from an ASP.NET Web application.
VWD(Visual Web Developer ) is by far the most extensive and feature-rich
integrated development environment (IDE) for building ASP.NET web pages. The
abbreviation IDE refers to the way all the separate tools you need to build complex
web applications are integrated in a single environment. Instead of writing code in a
text editor, compiling code at the command line, writing HTML and CSS in a separate
application, and managing your database in yet another, VWD allows you to perform
all of these tasks, and more, from the same environment. Besides the efficiency this
brings because you don’t have to constantly switch tools, this also makes it much
easier to learn new areas of VWD, as many of the built-in tools work in the same way.
5. Fig: VWD Express edition 2008
The Document Window is the main area in the middle of the application. This is
where most of the action takes place. You can use the Document Window to work
with many different document formats, including ASPX and HTML files, CSS and
JavaScript files, code files for VB and C#, XML and text files, and even images.
ASP.NET 4.6 is the latest official version of ASP.NET.
6. 4>> Webpages to web forms
ASP.NET Web Pages is a framework that you can use to create dynamic web pages.
Web Pages provides an easy way to combine HTML, CSS, and server code:
Easy to learn, understand, and use
Uses an SPA application model (Single Page Application)
Similar to PHP and Classic ASP
VB (Visual Basic) or C# (C sharp) scripting languages
WebMatrix is a tool that integrates a web page editor, a database utility, a web server for
testing pages, and features for publishing your website to the Internet. WebMatrix is free,
and it's easy to install and easy to use.
ASP.NET Web Forms is a part of the ASP.NET web application framework and is included
with Visual Studio. It is one of the four programming models you can use to create
ASP.NET web applications, the others are ASP.NET MVC, ASP.NET Web Pages, and
ASP.NET Single Page Applications.
Web Forms are pages that your users request using their browser. These pages can be
written using a combination of HTML, client-script, server controls, and server code.
ASP.NET Web Forms are:
· Based on Microsoft ASP.NET technology, in which code that runs on the server
dynamically generates Web page output to the browser or client device.
· Compatible with any browser or mobile device. An ASP.NET Web page automatically
renders the correct browser-compliant HTML for features such as styles, layout, and so
on.
· Compatible with any language supported by the .NET common language runtime,
such as Microsoft Visual Basic and Microsoft Visual C#.
· Built on the Microsoft .NET Framework. This provides all the benefits of the framework,
including a managed environment, type safety, and inheritance.
· Flexible because you can add user-created and third party controls to them.
ASP.NET Web Forms offer:
Separation of HTML and other UI code from application logic.
7. A rich suite of server controls for common tasks, including data access.
Powerful data binding, with great tool support.
Support for client-side scripting that executes in the browser.
Support for a variety of other capabilities, including routing, security,
performance, internationalization, testing, debugging, error handling and state
management.
Formore https://docs.microsoft.com/en-us/aspnet/web-forms/what-is-web-forms
5.>> Html-asp.net state management,important objective
HTTP is a stateless protocol. A few techniques can be used to maintain state
information across multiple HTTP requests, namely,
* Cookie:-A cookie is a small piece of information that a server sends to a browser
and stored inside the browser. The browser will automatically include the cookie in
all its subsequent requests to the originating host of the cookie. Take note that
cookies are only sent back by the browser to their originating host and not any other
hosts. In this way, the server can uniquely identify a client (or a browser).
* Hidden fields of the HTML form.: The principle is to include an HTML form with a
hidden field containing a session ID in all the HTML pages sent to the client.
* URL rewriting: The principle is to include a unique session ID in all the URLs issued
by the client, which identifies the session. For example,
http://host:port/shopping.html;sessionid=value
A new instance of the Web page class is created each time the page is posted to the
server. In traditional Web programming, this would typically mean that all
8. information associated with the page and the controls on the page would be lost with
each round trip.
ASP.NET offers you a variety of ways to maintain state information on the server,
rather than persisting information on the client. With server-based state management,
you can decrease the amount of information sent to the client in order to preserve
state, however it can use costly resources on the server.
Application State
Session State
Some Objectives of ASP.net:
Create a Web form with server controls
Separate page code from content with code-behind pages, page controls, and
components
Display dynamic data from a data source by using ADO.NET and data binding
Debug .NET Active Server Pages.
ASP.NET provides services to allow the creation, deployment, and execution of
Web Applications and Web Services
Web Applications are built using Web Forms.
Web Forms are designed to make building
web-based applications as easy as building Visual Basic applications
Built on .NET Framework: any .NET programming language can be used (C#,
Visual Basic)
Complete object model.
Separation of code and UI
Maintains page state
Session management
Caching, Debugging, Extensibility.
9. >>. 6 Asp.net execution scenario
.NET application execution: 2 very important components of .NET. -
1. FrameWork class library : The FrameWork class library contains all reusable
classes, Interfaces and basic types for use within the applications we develop.
The framework classes are present in different namespaces and physically
packaged into assemblies.
2. Common Language runtime(CLR) : CLR is the runtime with in which .NET
applications run. .NET applications do not run directly run on top of operating
system, instead they run on CLR. The CLR is present on top of the operating
system. CLR is a layer between operating system and our application which will
convert the Intermediate language into native code that the underlying operating
system can understand.
.NET applications are executed :-
1. We develop .NET applications with any of the programming languages supported
by .NET like C#,VB,J# or C++.
2. The application is then compiled with the compiler, which produces Intermediate
Language(IL) and physical packaged into an assembly. Assemblies in .NET will
have a .dll or .exe extension depending upon the application type. For example a
web application compilation produces .dll where as a console or windows
application compilation produces .exe in general. No matter in which language we
have developed the application, after we compile the application Intermediate
Language is produced.
3. The assembly that is produced as a result of compilation of .NET application, then
runs on CLR. CLR is a layer between operating system and our application. CLR
internally hosts a JIT(Just In Time) compiler, which will convert Intermediate
Language into object code that the Operating system can understand.
4. When we close the application, the object code is thrown away. Usually object
code is not stored any where. Every time we run the application, the JIT
10. compilation happens and the object code is generated and present in the memory
as long as the application is active and running.
Fig: Execution of .net
* ASP.NET creates an environment which can process the request. In other words, it
creates the application object, request, response and context
objects to process the request.
* Once the environment is created, the request is processed through a series of events
which is processed by using modules, handlers and page
objects. To keep it short, let's name this step as MHPM (Module, handler, page and
Module event), we will come to details later.
11. 7 C# .net role in ASP.net development
C# is an elegant and type-safe object-oriented language that enables developers to
build a variety of secure and robust applications that run on the .NET Framework. C#
syntax is highly expressive, yet it is also simple and easy to learn.
In addition to these basic object-oriented principles, C# makes it easy to develop
software components through several innovative language constructs, including the
following:
* Encapsulated method signatures called delegates, which enable type-safe event
notifications.
* Properties, which serve as accessors for private member variables.
*Attributes, which provide declarative metadata about types at run time.
*Inline XML documentation comments.
*Language-Integrated Query (LINQ) which provides built-in query capabilities across a
variety of data sources.
C# programs run on the .NET Framework, an integral component of Windows that
includes a virtual execution system called the common language runtime (CLR) and a
unified set of class libraries.
When the C# program is executed, the assembly is loaded into the CLR, which might
take various actions based on the information in the manifest. Then, if the security
requirements are met, the CLR performs just in time (JIT) compilation to convert the IL
code to native machine instructions. The CLR also provides other services related to
automatic garbage collection, exception handling, and resource management. Code that
is executed by the CLR is sometimes referred to as "managed code," in contrast to
"unmanaged code" which is compiled into native machine language that targets a
specific system.
12. Fig C# .net integration
* C# allows design time and run time attributes to be included.
* It allows integrated documentation using XML.
* No header files, IDL etc. are required.
* it can be embedded into web pages.
https://www.cs.colorado.edu/~kena/classes/5448/f12/presentation-materials/
dhall.pdf
https://www.slideshare.net/AndyButland/aspnet-5-and-c-6?qid=3d45fd80-dd0
9-42dd-84c8-da703e796e9a&v=&b=&from_search=19
13. 8 Asp.net /C# industry approach
* ASP.NET and C# allows the development of software ranging from simple web form to
big enterprise-level applications.
* At Singsys we combine ASP.NET technology with C# for the development of client side
and server side web applications. Our C# and .NET development team makes maximum
benefits of .NET framework and C# technology to provide robust, scalable and powerful
solutions. Our professional C# asp dot net developers have hands-on experience in .NET
technology and uses industry best practices to ensure our C# ASP.NET solutions meet your
enterprise business needs.
Designing and building .NET Components.
Custom ASP.NET and C# web development.
Custom ASP.NET and C# desktop applications development.
Mobile applications development.
Enterprise application integration.
Web services design and development.
11 Consuming ASP.net controls in web-forms
A common scenario in ASP.NET Web Forms applications is to populate a webpage
with controls, and then perform a specific action based on which control the user
clicks. For example, a System.Web.UI.WebControls.Button control raises an event
when the user clicks it in the webpage. By handling the event, your application can
perform the appropriate application logic for that button click.
To handle a button click event on a webpage
* Create a ASP.NET Web Forms page (webpage) that has a Button control with the
OnClick value set to the name of method that you will define in the next step.
14. XML: <asp:Button ID="Button1" runat="server" Text="Click Me"
OnClick="Button1_Click" />
* Define an event handler that matches the Click event delegate signature and that
has the name you defined for the OnClick value.
C# code: protected void Button1_Click(object sender, EventArgs e)
{
// perform action
}
The Click event uses the EventHandler class for the delegate type and the EventArgs
class for the event data. The ASP.NET page framework automatically generates code
that creates an instance of EventHandler and adds this delegate instance to the Click
event of the Button instance.
* In the event handler method that you defined in step 2, add code to perform any
actions that are required when the event occurs.
Set the OnClick attribute in the Button element to the event handler method.
<asp:Button
id = "Button" OnClick = "Button_Click" Text = "Click Me"
runat = server/>
15. Rendering asp application
Simple startup application;The Login control can use settings in the Web.config file to
manage membership authentication automatically. However, if your application requires
you to customize how the control works, or if you want to understand how Login control
events relate to the page life cycle, you can use the events listed in the following table.
Control
Event
Typical Use
LoggingIn
Raised during a postback, after the page's LoadComplete event has
occurred. This event marks the beginning of the login process.
Use this event for tasks that must occur prior to beginning the
authentication process.
Authenticate
Raised after the LoggingIn event.
Use this event to override or enhance the default authentication behavior
of a Login control.
LoggedIn
Raised after the user name and password have been authenticated.
Use this event to redirect to another page or to dynamically set the text in
the control. This event does not occur if there is an error or if
authentication fails.
LoginError
Raised if authentication was not successful.
Use this event to set text in the control that explains the problem or to
direct the user to a different page.
Developed by: Mani bhushan jha
bhushann09@yahoo.in