.Net Web development 2

unserstanding between both is --we will talk in port http port 80 (443 for https)

Request is a text
GET /default.html HTTP/1.1
Host: www.janaganamana.net

Above GET can be any of the following
OPTIONS/GET/HEAD/post/put/delete/TRACE/CONNECT/DEBUG


btw.DAV-distributed authoring and versioning in a superset of http with extra features like file manipulations add delete ...


this is typical response

HTTP/1.1 200 OK Server: Microsoft-IIS/6.0 Content-Type: text/html Content-Length: 38

<html><body>Hello, world.</body><html>

200 is - i am OK you are OK
SERVER can be something else too
Content types can be text image audio video


Most ly these codes are
1xx I got it wait... to process.
2xx I am OK you are OK Success
3xx More action needed
4xx I am ok you are not OK
Client Error
5xx I am not OK you are OK
Server Error


btw.. one important note -- When you access a page we get lot of text but not all images. images are asked later again when client see tags like <img>.

telnet (change port from 23 to 80) can simulate your browser. Believe me Notepad too can do that :) try to open http://www.hotmail.com from notepad.

btw ...GET or POST may decide your IsPostBack
YOUR single webpage in asp.net may contain an aspx page and an aspx.cs page

If you dont seperate them mostly you are doing inline coding. Otherwise codebehind. Your codebehind may be using other codebehind--helper classes.
Fornow--Yourpage is a class.


Read about ..Active mode ftp and passive mode ftp
Folowing folders tell some coding standards - don't get confused.

App_Browsers identify browsers and determine their capabilities.
App_Code helper classes
App_Data Contains application data files .mdf /.xml
App_GlobalResources .resx and .resources files
App_LocalResources localised resources
App_Themes .skin and .css files
App_WebReferences will have Web reference files .wsdl, .xsd, .disco, and .discomap
files)
Bin Contains compiled assemblies
all your webapplications follow UUNO(until and unless not overridden) in web.config
Your webpages in one app will follow web.config UUNO in sub folder web.config file

%WINDIR%\Microsoft.NET\Framework\version\Config\machine.config



web based app for webadministration is provided for
security
application configuration
Provider configuration



btw... TRACE is one setting in web.config
<trace
enabled="false" // enable?
requestLimit="10" // requests to cache
pageOutput="false" //directly on page
traceMode="SortByTime" //
localOnly="true" // only on server machines's apps
mostRecent="true" //
/>

Inside TRACE

Request Details
Trace Information
Control Tree
Session State
Application State
Request Cookies Collection
Headers Collection
Form Collection
QueryString Collection
Server Variables


Fundamentals of HTML webpages -- lot of html tags like .........

Fundamentals of asp.net is Control Plus HTML (where control also renders to a html)


Derived from control are
Webcontrol
HTML control
Template Control -- > page
Specialized controls

It is all in a moment of giving response - all objects take birth and die.


btw -- viewstate is a control that renders to a hidden form tag -- (webserver knows how to read it on postback)

Life of a control

1 LoadControlState Loads the ControlState of the control
2 LoadViewState
3 LoadPostData
4 Load (OnLoad) control is stable at this time. it is reconstructed.
5 RaisePostDataChangedEvent Is defined on the interface
6 RaisePostbackEvent Handles the client-side event that caused the Postback
7 PreRender (OnPreRender) Allows last-minute changes to the control.

8 SaveControlState Saves the current control state to ViewState.
9 SaveViewState Saves the current data state of the control to ViewState.
10 Render Generates the client-side HTML
11 Dispose Accepts cleanup code..
12 UnLoad
htmlcontrol - Image
- Link
InputControl Button
TExt
hidden
HTMLContainer Genericcontrol


Web server controls offer more functionality and a more consistent programming model than HTML server controls. Web server controls may also render as many HTML tags and may also include client-side JavaScript code. This means that it is possible
to create very elaborate Web server controls, such as a calendar control or a data grid control.


GridView control is a naming container.
The naming container for a given child control is a control above it (parent or higher) in the hierarchy that implements the INamingContainer interface. A server control implements this interface to create a unique namespace for populating the UniqueID property values of its child server controls. The UniqueID property contains the fully qualified name of the control. The difference between this property and the ID property
is that the UniqueID property is generated automatically by the NamingContainer and contains the NamingContainer information.
use FindControl for finding controls within naming container

Control c = FindControl("lblMessage");



AccessDataSource
SqlDataSource
XmlDataSource
ObjectDataSource
SitemapDataSource



HeaderTemplate
FooterTemplate
ItemTemplate
AlternatingItemTemplate
SelectedItemTemplate
SeparatorTemplate
EditItemTemplate


<%# Eval("Vin") %>