Friday, June 22, 2012

Parse and TryParse

Parse
   This function will take a string and convert it and then return the integer.
It will throw FormatException if it cant parse
Throw OverflowException if it is too large
Throw ArgumentException if it is null value

TryParse
   This wont throw any exception. It returns a boolean if it was able to successfully parse a number
ex., int.Tryparse(string, out result).

Data Controls


Repeater :

    It contains  Header Template, Item template , alternate
Item template and footer template . it can't support
Selection, editing, sorting and paging. this is read only
and fast.


Datalist :

   It contains Header Template, Item template , alternate
Item template , Edit item template and footer template . it
can't support sorting and paging but supports selection and editing


DataGrid(or GridView) :

It contains Header Template, Item template , alternate Item
template , Edit item template and footer template .it can
support selection, editing , sorting and paging . Mostly
every developer caught used this control  .


Monday, March 29, 2010

WebServer and ApplicationServer

WEB SERVER:
Web servers are computers on the Internet that host websites, serving pages to viewers upon request.
A Web server handles the HTTP protocol. When the Web server receives an HTTP request it responds with an HTTP response such as sending back an HTML page.
Webserver is designed for Website deployments and web based apps.

APPLICATION SERVER:
Application server is a server that provides XML web Services, WEb Applications and distributed apps.
An application Server exposes business logic to client applications through various protocols possibly including HTTP.
Application Server is used to Deploy an Application and then that application can be accessed using webserver.


The difference between WebServer and ApplicationServer is
1. Web Server serves static HTML pages or gifs, jpegs, etc.,
An Application Server is used to run business logic or dynamically generated presentation code.
2. A Web Server understands and supports only HTTP protocol, an Application Server supports HTTP,TCP/IP and many more protocols.
3. Application Server will take care of all these issues like Security Transaction Multithreading Resource pooling etc...
In Web Server it is not possible...

PROTOCOLS

HTTP(HyperText Transfer Protocol) is a request/response standard typical of client-server computing.
FTP (File Transfer Protocol) is a standard network protocol used to exchange and manipulate files over a TCP/IP-based network, such as the Internet
SMTP(Simple Mail Transfer Protocol) stands for simple mail transfer protocol.
POP3(Post Office Protocol) is an acronym Post Office Protocol.

The difference is POP is a protocol for storage of email. SMTP is a protocol for sending and receiving.

Friday, March 26, 2010

ASP.Net Page Life Cycle

Understanding the Pagelife cycle is important to develop ASP.Net application.

The general Page Life Cycle Stages are:
1. Page request - Here Page is requested by the user.
2. Start – Sets the properties such as Request, Response, IsPostBack and UICulture.
3. Page initialization - Controls on the page are available and each control's UniqueID property is set.
4. Load – Controls are loaded here if it is a PostBack request.
5. Validation – Sets the IsValid property.
6. Postback Event handling – Event handlers will be called if it is PostBack.
6. Rendering - the page calls the Render method for each control, providing a text writer that writes its output to the OutputStream of the page's Response property.
7. Unload - Unload is called after the page has been fully rendered, sent to the client, and is ready to be discarded.

Common life cycle Events:
1. PreInit – Start event of the Page life cycle and here every page controls are initialized.
2. Init – This is used to read or initialize control properties.
3. InitComplete – Used for processing tasks that require all initialization be complete.
4. PreLoad - This is used before Perform any processing that should occur before Load.
5. Load - Use the OnLoad event method to set properties in controls and establish database connections.
6. Control Event - These are control specific events such as – Button Click, DropDownIndexChanged etc.
7. Load Complete - This event is used for performing those tasks which require load has been completed.
8. PreRender - In this event page insures that all child controls are created.
9. SaveStateComplete - This event occurs after viewstate encoded and saved for the page and for all controls.
10. Render – This is not an event. The page instance calls this method to output the control’s markup, after this event any changes to the page or controls are ignored.
11. Unload – Nothing but cleanup task like closing the files, database connections etc.,

This table shows stages and corresponding Events

Stage Events/Method
Initialization of the page Page_Init
Loading of the View State LoadViewState
processing of the Post back data LoadPostData
Loading of Page Page_Load
Notification of PostBack RaisePostDataChangedEvent
Handling of PostBack Event RaisePostBackEvent
Pre Rendering of Page Page_PreRender
Saving of view state SaveViewState
Rendering of Page Page_Render
Unloading of the Page Page_UnLoad

Friday, January 15, 2010

Friday, July 10, 2009

Silverlight websites

There are two types of Silverlight web sites that you can create in Visual
Studio 2008:
Ordinary HTML web site: In this case, the entry point to your Silverlight application is a basic HTML file that includes a Silverlight content region.
ASP.NET web site: In this case, Visual Studio creates two projects?one to contain the Silverlight application files, and one to hold the server-side ASP.NET web site that will be deployed alongside your Silverlight files.

The entry point to your Silverlight application can be an ordinary HTML file or an ASP.NET web form that also includes server-generated content.
No matter which option you choose, your Silverlight application will run the same way,the client browser will receive an HTML web page, that HTML page will include a Silverlight content region, and the Silverlight
code will run on the local computer, not the web server.

However, the ASP.NET web approach makes it easier to mix ASP.NET and Silverlight content.