Posts

State Management and ways to handle Cache in Web Farm/Web Garden scenario

Image
Basics about State management: As we all know,web is stateless .A Web page is recreated every time it is posted back to the server.In traditional web programming, that all the information within the page and control gets wiped off on every  post back . To overcome this problem,ASP.NET framework provides various ways to preserve the states at various stages like controlstate,viewstate, cookies, session etc.These can be defined in at client side and server side state management. What is AppDomain An AppDomain can be defined as light weight process and is used for security isolation and availability. AppDomain is hosted on some process and a Process can host multiple AppDomains. So one AppDomain can go down/restarts without affecting other AppDomains in the same process. Role of AppDomain in ASP.NET: AppDomain  plays a key role in asp.net. When ASP.NET receives first request, the Application manager creates an application domain for it, Application domain are very importa...

view state difference session state

Session state  is the feature of ASP.NET based web applications using which values of a variable may be persisted and then posted to another page. Viewstate  property of a page or a control, or a viewstate object for a variable value, may also be created to persist its value across a postback. However, the viewstate value are for page level  , i.e. they cannot be posted across to another page. Session State is useful for storing values that must be persisted across multiple pages by the same user. ViewState is useful for storing serializable data that must be persisisted across PostBacks by a single page. If you use Session State, the value you insert will remain in memory until (1) The Session times out, or (2) Your code removes it. If you use ViewState, the value you insert will remain in ViewState until the user requests a different page. ViewState stores data betwen PostBacks by putting it into a hidden form field on the client HTML doc. when the doc is Posted Back, t...

viewstate : statemanagement

Client side State management Options: ASP.NET provides various client side state management options like Cookies, QueryStrings (URL), Hidden fields, View State and Control state (ASP.NET 2.0). Let's discuss each of client side state management options. Bandwidth should be considered while implementing client side state management options because they involve in each roundtrip to server. Example: Cookies are exchanged between client and server for each page request. View State: View State can be used to store state information for a single user. View State is a built in feature in web controls to persist data between page post backs. You can set View State on/off for each control using EnableViewState  property. By default,  EnableViewState  property will be set to true. View state mechanism poses performance overhead. View state information of all the controls on the page will be submitted to server on each post back. To reduce performance penalty, disable...

difference between stored procedure and function

Below are few differences between Stored Procedure and Function 1) Stored procedure are compiled for first time and compiled format is saved and executes compiled code when ever it is called. But function is compiled and executed every time it is called. 2) Function must return a value but in stored procedure it is optional. 3) Function takes one input parameter it is mandatory but stored procedure may take o to n input parameters. 4) Functions can be called from select statement, but stored procedures can not be called from select statement. 5) We can build logic in functions and we can even break complex logic in to methods. 6) We can use try catch statements in stored procedures but in functions we can not use. 7) We can not use insert,delete,update and create statements in functions but in stored procedures we can use those statements. 8 ) Functions can have only input parameters but stored procedure can have input and out put parameters Thanks and Regar...

Difference between Respone.Redirect and server.transfer

Introduction This article tell you the difference between  Server.Transfer  and  Response.Redirect. Server.Transfer v/s Response.Redirect Both “Server” and “Response” are objects of ASP.NET. Server.Transfer and Response.Redirect both are used to transfer a user from one page to another page. Both are used for the same purpose but still there are some differences are there between both that are as follows: Syntactically both are different, if you want to transfer the user to a page named newpage.aspx then syntax for both methods will be, Response.Redirect(“newpage.aspx”)  and  Server.Transfer(“newpage.aspx”) Response.Redirect involves a roundtrip to the server whereas Server.Transfer conserves server resources by avoiding the roundtrip. It just changes the focus of the webserver to a different page and transfers the page processing to a different page. Roundtrip means in case of Response.Redirect it first sends the request for the new page to the browser t...