ASP.NET Introduction, Create Website using ASP.NET

ASP.NET is a technology which  provides set of specifications for building web based

App towards server side Execution

->ASP.NET is providing 2 things:

1. .Net Languages programming towards server side coding

It supports  vb.net/c# programming.[no vc++.net or f# programming]

2.collection of objects called ASP.net intrinsic objects.

   Response,request,session,application,server and cache

ASP.net=.net languages programming+collection of objects

->ASP.net supports different types of web based application development.

1.normal web application.

     Developing dynamic web pages like login page,---

2.webservices

     Developing business logic to integrate different vendor app’s.

3.Ajax web application:

[asynchronus java script and xml]

                     Developing web pages implementing Ajax specifications,

                     The importance of Ajax is avoiding complete page submission

4.silverlight integration :

      it  supports rich internet application development RIA means implementing shapes,

     animations,videostreaming,transformations,------into webpage development.

5.MVC application:

Developing web pages with the concept of MVC, the advantage is testing will become easier

->the current version is ASP.NET  4.0 to wards.NET4.0[asp.net3.5 towards.net3.5]

 

ASP.NET 4.0 provides following features:

1.url routing

2.chart control

3.dynamic data

4.silverlight 3.0 integration

5.MVC integration

Request and Response objects:

->request object can be used to read the info comes with

   Client request

          The info can be form data[email id,pass word],browser inf”,----

->response object can be used to send the inf” from server to client.

  The info can be normal text,url-----

1.write

         It will send text from server to client

2.Redirect

         It will perform redirection to other webpage.

3.End

      It will stop page processing[no more responses will be given to client]

->ASP3.0 supports scripting languages towards serverside  programming,scripting languages are

Interpreter based,this doesn’t provide better performance and no proper memory management.

->ASP.NET supports compiler based languages,this provides better  performance and proper

Memory management.

->serverside code requires unique identification.

<%

    --------

  -------

%>

Creating ASP.NET Web Site:

Open notepad =>

      <html>

    <body>

    <h1>

<%

   Response .write(“server side processing”)

%>

</body>

</html>

=> Save as first.aspx[e:\aspnet 103]

Note:

->ASP.NET page extension is aspx[active server pages extension]

->the server side code will be processed by web server and output will be produce towards

Client browser, this output will not contain any server side statements, it contains only html

Content.

Go to view menu browser =>   Select Source       

                         <html>->content provided by server to browser

                         </html>

->ASP.net page execution takes place at 2 places:

->web server will execute server side code present in page.

->browser will execute html tags and client side script given by web server.

->Default language for asp.net is vb.net

Page directive:

*Directive is an instruction to server ,it should be first

 Statement with in webpage.

*page directive can be used to provide different instruction to server,it can changing,

Attaching theme,-----

<%@directivename options%>->syntax of directive

Creating ASP.net webpage using c#:

                    Open  Notepad=>      

                <%@page language=”cs”%>

                  <html>

                <body>

<%

           Response.Write(“asp.net page using c#”);

%>

</body>

</html>

*Save as page.aspx

*Browser

http://localhost/aspnetweb/page.aspx

Note:

->c# is case sensitive

->In c# statement to be ended with;

ASP.NET page Execution [ASP.NET architecture]:

->server system requires IIs installation and.net installation.

->.NET installation will configure IIs with aspnet_isapi.dll

Aspnet_isapi->ASP.NET internet server application programming interface.

->Aspnet_isapi.dll acts like mediator between webserver

->client request to webserver will be received by inetinfo.exe,

It will verify requested file extension,if it is html the code will be copied to client

Browser,if it is aspx the request will be forwarded to asp.net worker process using

Aspnet_isapi.dll.

->ASP.NET worker process[exefile]can be called as asp.net

Engine(or)asp.net runtime,it will encapsulate all the.net services needed for  asp.net

Page execution.

ASP.net worker process will perform following steps:

->it will compile asp.net page into dll file.

First.aspx-><>.dll

->dll will maintain a webpage in the form of class.

->webpage class object will be created to process page execution and output

Will be given to client browser.

->webpage dll will be maintained for serving to different clients requests, this provides

Better performance.

Location of webpage dll in server system:

A folder will be created with in temporary ASP.net files folder to maintain webpage dll’s

C:\windows\microsoft.net\frame work\v2.0(or)4.0

                  \temporary asp.net files

                 \aspnet 103 vir\----

              System.web.jhu89.dll[web page dll]

       Page.aspx.kkhjh[xml doc]

->open xml doc with notepad

 

File=page.aspx

Assembly=system.web.jhu89.dll

When client request comes to webpage webserver will read xml doc

To identify webpage dll,the dll will loaded to process webpage and

Producing output client browser.

Designer for ASF.NET:

Designer is a advanced editor compare to notepad editor,this will reduce lot of coding

To developer,this makes developer job easier and development faster.

There are 2 designers available for asp.net

1.visual web developer[vwd]

2.visual studio[2008\2010]

->vwd supports only webpage based app development

Visual studio supports different types of app development.

->vmd license is cheaper compare to visual studio,the memory consumption will

Be less compare to visualstudio.

Starting visual studio to develop asp.net pages:

                    Start->Run

Devenv.exe[visual studio exe]=>   Goto file menu => Select new website =>

    Visual basic

      Visual c#-----ASP.NET website

  Location-filesystem  e:\aspnet103\demo

                       Ok

->add webpage into website

     Goto website menu =>   Add new item => Select web form

Name-Default2.aspx

         Add

->designer will include default content into web page[default2.aspx]

<%@ page language=”c#”-----%>

         ----

<body>                             //only HTMLcontent will be displayed

<h1>

<%

  Response.write(“asp.net page using vs2010”);

%>

<\h1>

->cntrl+f5

[it will activate browser to call web page]

Note :

->VS 2008/vs2010 is called multi version environment,it supports application

Developer towards 2.0to4.0.

->visual studio will create a folder towards websites,in this all the website related files

Will be stored.

e:\aspnet103\demo

Demo folder will be created to place website files[default 2.0aspx]

->visual studio supports website development towards 3 locations:

1.file system

           The website will be managed by personal webserver called”cassini web server”

This webserver is built in with visual studio,inthis case IIs is not required

2.Http:

  The website will be managed by webserver IIs.

Location-http                    http\\localhost\virdirname\websitename

3.FTP:

The website will be managed by FTP server,this is required when web server is Present in remote location.