Skip to main content

ASP.NET State Management Overview

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 information associated with the page and the controls on the page would be lost with each round trip. For example, if a user enters information into a text box, that information would be lost in the round trip from the browser or client device to the server.
To overcome this inherent limitation of traditional Web programming, ASP.NET includes several options that help you preserve data on both a per-page basis and an application-wide basis. These features are as follows:
• View state
• Control state
• Hidden fields
• Cookies
• Query strings
• Application state
• Session state
• Profile Properties

View state, control state, hidden fields, cookies, and query strings all involve storing data on the client in various ways. However, application state, session state, and profile properties all store data in memory on the server. Each option has distinct advantages and disadvantages, depending on the scenario.

Download Professional C#.NET 2008 at
http://www.ziddu.com/download/10795582/rofessionalC2008andtheNET3.5PlatformFourthEdition.pdf.html

Comments

Popular posts from this blog

Difference between two Dates in C#.NET ?

To find the difference between two dates is very simple in VB — By using DateDiff method. But in C#, there is no direct method to do so. but there is a way to achive this. For this we need to understand TimeSpan Class. The following code snippet will show you how to find the difference. DateTime startTime = DateTime.Now; DateTime endTime = DateTime.Now.AddSeconds( 75 ); TimeSpan span = endTime.Subtract ( startTime ); Console.WriteLine( “Time Difference (seconds): ” + span.Seconds ); Console.WriteLine( “Time Difference (minutes): ” + span.Minutes ); Console.WriteLine( “Time Difference (hours): ” + span.Hours ); Console.WriteLine( “Time Difference (days): ” + span.Days ); By concatenating all this you will get the difference between two dates. You can also use span.Duration(). There are certain limitations to. The TimeSpan is capable of returning difference interms of Days, Hours, mins and seconds only. It is not having a property to show difference interms of Months and years. Hope this

Splash Screen in Visual Studio 2008 using C#.NET

Creating Splash Screen is now very easy just follow these steps to make your application look very rich. 1.Suppose, Welcome.cs is your main form and SplashScreen.cs is your splash screen form. 2.Write the following code in the page_load event of your Welcome.cs form Hide(); bool done = false; ThreadPool.QueueUserWorkItem((x) => { using (var splashForm = new SplashForm()) { splashForm.Show(); while (!done) Application.DoEvents(); splashForm.Close(); } }); Thread.Sleep(3000); // Emulate hardwork done = true; Show(); 3. It's done!!

How to store image in a database in binary format

Create one empty web page and do the following things... 1.Drag & Drop FileUpload Control and one Button from standard Toolbox 2.Double click on button control it'll generate a button click event. In that event write the following code 3.business_logic is a class file and which is used for opening database conections, executing database queries,etc. You can may even directly declare directly the connections, commands in codebehind file(*.cs,*.vb) business_logic obj = new business_logic(); if (FileUpload1.HasFile) { // Storing image in Database BinaryReader reader = new BinaryReader(FileUpload1.PostedFile.InputStream); byte[] image = reader.ReadBytes(FileUpload1.PostedFile.ContentLength); string temp= obj.assignconn(); con = new SqlConnection(temp); con.Open(); cmd.Connection = con; cmd.CommandText = "sp_imageInsert"; cmd.CommandType = CommandType.StoredPr