SlideShare a Scribd company logo
Disclaimer: This presentation is prepared by trainees of
baabtra as a part of mentoring program. This is not official
document of baabtra –Mentoring Partner
Baabtra-Mentoring Partner is the mentoring division of baabte System Technologies Pvt .
Ltd
Typing Speed
Week

Target Achieved

1

30

27

2

30

28

3
Jobs Applied
#
1
2
3

Company

Designation

Applied Date

Current Status
State Management

Name
@gmail.com
www.facebook.com/username
twitter.com/username
in.linkedin.com/in/profilename
Phonenumber
Why is state necessary?
• The vast majority of Internet applications
operate using the HTTP protocol.
• HTTP is state less.
– This means that each request for a page is treated
as a new request by the server.
Introduction to State Management
• Remember that ASP.NET is stateless
– The Web server does not keep track of past client
requests

• Different technologies handle the issue of
statement management differently
– ASP.NET is quite unique in this regard
Types of State Management
• ASP.NET offers two categories of state
management
– Pure client-side statement management
– Server-side state management
Client State Management
•
•
•
•
•

View state
Control state
Hidden fields
Cookies
Query strings
State Management
(ViewState)
•

•

ASP.NET preserves the state of the page’s controls between
post backs by packaging and encoding it within a hidden
html field.
This view state feature can also be used programmatically to
preserve additional information between post backs for the
same page

Eg :-

ViewState["RequestCount"] = count;
int count = (int)ViewState["RequestCount"];
Advantages & Disadvantage of
View State
• It consumes no server memory.
• It is more hidden than Query String and Hidden
Fields
• Its possible to encrypt View State information.
Disadvantage :– It increases the size of the page.
State Management
(ControlState)
• The ControlState property allows you to
persist information as like the view state.
– The ControlState data is stored in hidden
fields.
Control State Application
• If we create a custom control that requires
view state to work properly.
• We should use control state to ensure other
developers don’t break your control by
disabling view state.
State Management
(Hidden Fields)
• Use the HiddenField control to store
persisted data.
• The data is stored in the Value property
• It’s simple and requires no server resources
State Management
(Query Strings)
• A query string can be used to submit data
back to the same page or to another page
through the URL.
Eg :string url = "productPage.aspx?id=" + id;
Response.Redirect(url);
productPage.aspx
int id = Convert.ToInt32(Request["id“]);
Disadvantages of Query String
• Not secured (its visible completely in the
address bar to the users)
• The maximum allowable length of a query
string varies from browser to browser(IE only
allows only 2k of url)
State Management
(Cookies)
• Cookies are a client-side approach for
persisting state information.
• These pairs accompany both server requests
and responses within the HTTP header
• Eg:HttpCookie cookie = new HttpCookie("Name",txtName.Text);
// Set expiry date to 1 day, 12 hours from now
cookie.Expires = DateTime.Now + new TimeSpan(1, 12, 0, 0);
Response.Cookies.Add(cookie);
Cookie Limitations
• While simple, cookies have disadvantages
• A cookie can only be 4096 bytes in size

• Most browsers restrict the total number of
cookies per site
• Users can refuse to accept cookies so don’t try
to use them to store critical information
Server State Management
• Application state
• Session state
Session state
• Session state is a server-based state
mechanism that allows you to store data in a
dictionary-style collection.
• It is scoped to the current browser session.

• That is, each user or browser session has a
different session state.
Example
• session[“uname”]=txt_uname.text;
String uname=session[“uname”].Tostring();
Application state
• Application state is a server-stored state
mechanism that allows you to store global
data in a dictionary-style collection that is
accessible from all pages in the Web
application.
Application state
• Thus, application state is ideal for storing
relatively small, frequently used sets of data
that do not change from user-to-user or
request to request.
• Eg :Application["SiteRequestCount"] = 0;
int count = (int)Application["SiteRequestCount";
If this presentation helped you, please visit our
page facebook.com/baabtra and like it.

Thanks in advance.
www.baabtra.com | www.massbaab.com |www.baabte.com
Contact Us
Emarald Mall (Big Bazar Building)
Mavoor Road, Kozhikode,
Kerala, India.
Ph: + 91 – 495 40 25 550

Start up Village
Eranakulam,
Kerala, India.
Email: info@baabtra.com

NC Complex, Near Bus Stand
Mukkam, Kozhikode,
Kerala, India.
Ph: + 91 – 495 40 25 550

More Related Content

What's hot

05 asp.net session07
05 asp.net session0705 asp.net session07
05 asp.net session07
Vivek chan
 
Using cookies and sessions
Using cookies and sessionsUsing cookies and sessions
Using cookies and sessions
Nuha Noor
 
Query Store and live Query Statistics
Query Store and live Query StatisticsQuery Store and live Query Statistics
Query Store and live Query Statistics
SolidQ
 
ASP.NET Lecture 4
ASP.NET Lecture 4ASP.NET Lecture 4
ASP.NET Lecture 4
Julie Iskander
 
Mysqlsecurityoptionsjan2021
Mysqlsecurityoptionsjan2021Mysqlsecurityoptionsjan2021
Mysqlsecurityoptionsjan2021
sepehrdamavandi2
 
Sql Server Security
Sql Server SecuritySql Server Security
Sql Server Security
Vinod Kumar
 
Advance Java
Advance JavaAdvance Java
Advance Java
Maitree Patel
 
Session viii(state mngtserver)
Session viii(state mngtserver)Session viii(state mngtserver)
Session viii(state mngtserver)
Shrijan Tiwari
 
Getting the most out of Amazon RDS investment with Toad for MySQL
Getting the most out of Amazon RDS investment with Toad for MySQLGetting the most out of Amazon RDS investment with Toad for MySQL
Getting the most out of Amazon RDS investment with Toad for MySQL
Brad Wulf, MBA
 
Кирилл Латыш "ERP on Websockets"
Кирилл Латыш "ERP on Websockets"Кирилл Латыш "ERP on Websockets"
Кирилл Латыш "ERP on Websockets"
Fwdays
 
Dg v1 3 ukoug_sg.pptx
Dg v1 3 ukoug_sg.pptxDg v1 3 ukoug_sg.pptx
Dg v1 3 ukoug_sg.pptx
Marcin Przepiórowski
 
Isaca sql server 2008 r2 security & auditing
Isaca sql server 2008 r2 security & auditingIsaca sql server 2008 r2 security & auditing
Isaca sql server 2008 r2 security & auditingAntonios Chatzipavlis
 
App Grid Dev With Coherence
App Grid Dev With CoherenceApp Grid Dev With Coherence
App Grid Dev With CoherenceJames Bayer
 
Android accounts & sync
Android accounts & syncAndroid accounts & sync
Android accounts & sync
Przemek Jakubczyk
 
Vm ware view manager training in hyderabad
Vm ware view manager training in hyderabadVm ware view manager training in hyderabad
Vm ware view manager training in hyderabad
Acutelearn Technologies
 
Offline db
Offline dbOffline db
Offline db
Ahmed Kamel Taha
 

What's hot (20)

05 asp.net session07
05 asp.net session0705 asp.net session07
05 asp.net session07
 
Using cookies and sessions
Using cookies and sessionsUsing cookies and sessions
Using cookies and sessions
 
Cache
CacheCache
Cache
 
Query Store and live Query Statistics
Query Store and live Query StatisticsQuery Store and live Query Statistics
Query Store and live Query Statistics
 
ASP.NET Lecture 4
ASP.NET Lecture 4ASP.NET Lecture 4
ASP.NET Lecture 4
 
Mysqlsecurityoptionsjan2021
Mysqlsecurityoptionsjan2021Mysqlsecurityoptionsjan2021
Mysqlsecurityoptionsjan2021
 
Training
TrainingTraining
Training
 
Sql Server Security
Sql Server SecuritySql Server Security
Sql Server Security
 
Advance Java
Advance JavaAdvance Java
Advance Java
 
Session viii(state mngtserver)
Session viii(state mngtserver)Session viii(state mngtserver)
Session viii(state mngtserver)
 
Getting the most out of Amazon RDS investment with Toad for MySQL
Getting the most out of Amazon RDS investment with Toad for MySQLGetting the most out of Amazon RDS investment with Toad for MySQL
Getting the most out of Amazon RDS investment with Toad for MySQL
 
Кирилл Латыш "ERP on Websockets"
Кирилл Латыш "ERP on Websockets"Кирилл Латыш "ERP on Websockets"
Кирилл Латыш "ERP on Websockets"
 
Dg v1 3 ukoug_sg.pptx
Dg v1 3 ukoug_sg.pptxDg v1 3 ukoug_sg.pptx
Dg v1 3 ukoug_sg.pptx
 
Isaca sql server 2008 r2 security & auditing
Isaca sql server 2008 r2 security & auditingIsaca sql server 2008 r2 security & auditing
Isaca sql server 2008 r2 security & auditing
 
App Grid Dev With Coherence
App Grid Dev With CoherenceApp Grid Dev With Coherence
App Grid Dev With Coherence
 
Android accounts & sync
Android accounts & syncAndroid accounts & sync
Android accounts & sync
 
Vm ware view manager training in hyderabad
Vm ware view manager training in hyderabadVm ware view manager training in hyderabad
Vm ware view manager training in hyderabad
 
Offline db
Offline dbOffline db
Offline db
 
Session and cookies,get and post
Session and cookies,get and postSession and cookies,get and post
Session and cookies,get and post
 
Lecture12
Lecture12Lecture12
Lecture12
 

Viewers also liked

As pnet pagelife_usha
As pnet pagelife_ushaAs pnet pagelife_usha
As pnet pagelife_usha
Rajalaxmi Pattanaik
 
Asp.net presentation by gajanand bohra
Asp.net presentation by gajanand bohraAsp.net presentation by gajanand bohra
Asp.net presentation by gajanand bohraGajanand Bohra
 
Presentation on asp.net controls
Presentation on asp.net controlsPresentation on asp.net controls
Presentation on asp.net controls
Reshi Unen
 
Asp Net Advance Topics
Asp Net Advance TopicsAsp Net Advance Topics
Asp Net Advance TopicsAli Taki
 
Master page in ASP . NET
Master page in ASP . NETMaster page in ASP . NET
State management
State managementState management
State managementIblesoft
 

Viewers also liked (11)

As pnet pagelife_usha
As pnet pagelife_ushaAs pnet pagelife_usha
As pnet pagelife_usha
 
Master page in asp.net
Master page in asp.netMaster page in asp.net
Master page in asp.net
 
Asp.net presentation by gajanand bohra
Asp.net presentation by gajanand bohraAsp.net presentation by gajanand bohra
Asp.net presentation by gajanand bohra
 
Presentation on asp.net controls
Presentation on asp.net controlsPresentation on asp.net controls
Presentation on asp.net controls
 
Asp Net Advance Topics
Asp Net Advance TopicsAsp Net Advance Topics
Asp Net Advance Topics
 
Master page in ASP . NET
Master page in ASP . NETMaster page in ASP . NET
Master page in ASP . NET
 
Web forms in ASP.net
Web forms in ASP.netWeb forms in ASP.net
Web forms in ASP.net
 
Controls in asp.net
Controls in asp.netControls in asp.net
Controls in asp.net
 
State management
State managementState management
State management
 
Introduction to asp.net
Introduction to asp.netIntroduction to asp.net
Introduction to asp.net
 
Asp.net.
Asp.net.Asp.net.
Asp.net.
 

Similar to State management in ASP.net

C# cookieless session id and application state
C# cookieless session id and application stateC# cookieless session id and application state
C# cookieless session id and application state
Malav Patel
 
State Management.pptx
State Management.pptxState Management.pptx
State Management.pptx
DrMonikaPatel2
 
state managment
state managment state managment
state managment aniliimd
 
ASP.NET State management
ASP.NET State managementASP.NET State management
ASP.NET State management
Shivanand Arur
 
Enterprise java unit-2_chapter-3
Enterprise  java unit-2_chapter-3Enterprise  java unit-2_chapter-3
Enterprise java unit-2_chapter-3
sandeep54552
 
State management 1
State management 1State management 1
State management 1singhadarsh
 
session and cookies.ppt
session and cookies.pptsession and cookies.ppt
session and cookies.ppt
Jayaprasanna4
 
Session and Cookies.pdf
Session and Cookies.pdfSession and Cookies.pdf
Session and Cookies.pdf
HamnaGhani1
 
State management in asp.net
State management in asp.netState management in asp.net
ASP.NET 12 - State Management
ASP.NET 12 - State ManagementASP.NET 12 - State Management
ASP.NET 12 - State Management
Randy Connolly
 
UNIT3 DBMS.pptx operation nd management of data base
UNIT3 DBMS.pptx operation nd management of data baseUNIT3 DBMS.pptx operation nd management of data base
UNIT3 DBMS.pptx operation nd management of data base
shindhe1098cv
 
Lecture32-Web-based-testing-II.pptx
Lecture32-Web-based-testing-II.pptxLecture32-Web-based-testing-II.pptx
Lecture32-Web-based-testing-II.pptx
Balkrishanpatidar
 
HTML5 Local Storage
HTML5 Local StorageHTML5 Local Storage
HTML5 Local Storage
Lior Zamir
 
Introduction and Basics to web technology .pptx
Introduction and Basics to web technology .pptxIntroduction and Basics to web technology .pptx
Introduction and Basics to web technology .pptx
LEENASAHU42
 
ASP.NET View State - Security Issues
ASP.NET View State - Security IssuesASP.NET View State - Security Issues
ASP.NET View State - Security Issues
Ronan Dunne, CEH, SSCP
 
Dotnet- An overview of ASP.NET & ADO.NET- Mazenet solution
Dotnet- An overview of ASP.NET & ADO.NET- Mazenet solutionDotnet- An overview of ASP.NET & ADO.NET- Mazenet solution
Dotnet- An overview of ASP.NET & ADO.NET- Mazenet solution
Mazenetsolution
 
Enterprise java unit-1_chapter-2
Enterprise java unit-1_chapter-2Enterprise java unit-1_chapter-2
Enterprise java unit-1_chapter-2
sandeep54552
 
enterprisejavaunit-1chapter-2-210914075956.pdf
enterprisejavaunit-1chapter-2-210914075956.pdfenterprisejavaunit-1chapter-2-210914075956.pdf
enterprisejavaunit-1chapter-2-210914075956.pdf
EidTahir
 
state management asp.net
 state management asp.net state management asp.net
state management asp.net
Pratiksha Srivastava
 
SCRIMPS-STD: Test Automation Design Principles - and asking the right questions!
SCRIMPS-STD: Test Automation Design Principles - and asking the right questions!SCRIMPS-STD: Test Automation Design Principles - and asking the right questions!
SCRIMPS-STD: Test Automation Design Principles - and asking the right questions!
Richard Robinson
 

Similar to State management in ASP.net (20)

C# cookieless session id and application state
C# cookieless session id and application stateC# cookieless session id and application state
C# cookieless session id and application state
 
State Management.pptx
State Management.pptxState Management.pptx
State Management.pptx
 
state managment
state managment state managment
state managment
 
ASP.NET State management
ASP.NET State managementASP.NET State management
ASP.NET State management
 
Enterprise java unit-2_chapter-3
Enterprise  java unit-2_chapter-3Enterprise  java unit-2_chapter-3
Enterprise java unit-2_chapter-3
 
State management 1
State management 1State management 1
State management 1
 
session and cookies.ppt
session and cookies.pptsession and cookies.ppt
session and cookies.ppt
 
Session and Cookies.pdf
Session and Cookies.pdfSession and Cookies.pdf
Session and Cookies.pdf
 
State management in asp.net
State management in asp.netState management in asp.net
State management in asp.net
 
ASP.NET 12 - State Management
ASP.NET 12 - State ManagementASP.NET 12 - State Management
ASP.NET 12 - State Management
 
UNIT3 DBMS.pptx operation nd management of data base
UNIT3 DBMS.pptx operation nd management of data baseUNIT3 DBMS.pptx operation nd management of data base
UNIT3 DBMS.pptx operation nd management of data base
 
Lecture32-Web-based-testing-II.pptx
Lecture32-Web-based-testing-II.pptxLecture32-Web-based-testing-II.pptx
Lecture32-Web-based-testing-II.pptx
 
HTML5 Local Storage
HTML5 Local StorageHTML5 Local Storage
HTML5 Local Storage
 
Introduction and Basics to web technology .pptx
Introduction and Basics to web technology .pptxIntroduction and Basics to web technology .pptx
Introduction and Basics to web technology .pptx
 
ASP.NET View State - Security Issues
ASP.NET View State - Security IssuesASP.NET View State - Security Issues
ASP.NET View State - Security Issues
 
Dotnet- An overview of ASP.NET & ADO.NET- Mazenet solution
Dotnet- An overview of ASP.NET & ADO.NET- Mazenet solutionDotnet- An overview of ASP.NET & ADO.NET- Mazenet solution
Dotnet- An overview of ASP.NET & ADO.NET- Mazenet solution
 
Enterprise java unit-1_chapter-2
Enterprise java unit-1_chapter-2Enterprise java unit-1_chapter-2
Enterprise java unit-1_chapter-2
 
enterprisejavaunit-1chapter-2-210914075956.pdf
enterprisejavaunit-1chapter-2-210914075956.pdfenterprisejavaunit-1chapter-2-210914075956.pdf
enterprisejavaunit-1chapter-2-210914075956.pdf
 
state management asp.net
 state management asp.net state management asp.net
state management asp.net
 
SCRIMPS-STD: Test Automation Design Principles - and asking the right questions!
SCRIMPS-STD: Test Automation Design Principles - and asking the right questions!SCRIMPS-STD: Test Automation Design Principles - and asking the right questions!
SCRIMPS-STD: Test Automation Design Principles - and asking the right questions!
 

More from baabtra.com - No. 1 supplier of quality freshers

Acquiring new skills what you should know
Acquiring new skills   what you should knowAcquiring new skills   what you should know
Acquiring new skills what you should know
baabtra.com - No. 1 supplier of quality freshers
 
Baabtra.com programming at school
Baabtra.com programming at schoolBaabtra.com programming at school
Baabtra.com programming at school
baabtra.com - No. 1 supplier of quality freshers
 
99LMS for Enterprises - LMS that you will love
99LMS for Enterprises - LMS that you will love 99LMS for Enterprises - LMS that you will love
99LMS for Enterprises - LMS that you will love
baabtra.com - No. 1 supplier of quality freshers
 
Php database connectivity
Php database connectivityPhp database connectivity
Chapter 6 database normalisation
Chapter 6  database normalisationChapter 6  database normalisation
Chapter 6 database normalisation
baabtra.com - No. 1 supplier of quality freshers
 
Chapter 5 transactions and dcl statements
Chapter 5  transactions and dcl statementsChapter 5  transactions and dcl statements
Chapter 5 transactions and dcl statements
baabtra.com - No. 1 supplier of quality freshers
 
Chapter 4 functions, views, indexing
Chapter 4  functions, views, indexingChapter 4  functions, views, indexing
Chapter 4 functions, views, indexing
baabtra.com - No. 1 supplier of quality freshers
 
Chapter 3 stored procedures
Chapter 3 stored proceduresChapter 3 stored procedures
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
Chapter 2  grouping,scalar and aggergate functions,joins   inner join,outer joinChapter 2  grouping,scalar and aggergate functions,joins   inner join,outer join
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
baabtra.com - No. 1 supplier of quality freshers
 
Chapter 1 introduction to sql server
Chapter 1 introduction to sql serverChapter 1 introduction to sql server
Chapter 1 introduction to sql server
baabtra.com - No. 1 supplier of quality freshers
 
Microsoft holo lens
Microsoft holo lensMicrosoft holo lens
Blue brain
Blue brainBlue brain
5g
5g5g
Aptitude skills baabtra
Aptitude skills baabtraAptitude skills baabtra

More from baabtra.com - No. 1 supplier of quality freshers (20)

Agile methodology and scrum development
Agile methodology and scrum developmentAgile methodology and scrum development
Agile methodology and scrum development
 
Best coding practices
Best coding practicesBest coding practices
Best coding practices
 
Core java - baabtra
Core java - baabtraCore java - baabtra
Core java - baabtra
 
Acquiring new skills what you should know
Acquiring new skills   what you should knowAcquiring new skills   what you should know
Acquiring new skills what you should know
 
Baabtra.com programming at school
Baabtra.com programming at schoolBaabtra.com programming at school
Baabtra.com programming at school
 
99LMS for Enterprises - LMS that you will love
99LMS for Enterprises - LMS that you will love 99LMS for Enterprises - LMS that you will love
99LMS for Enterprises - LMS that you will love
 
Php sessions & cookies
Php sessions & cookiesPhp sessions & cookies
Php sessions & cookies
 
Php database connectivity
Php database connectivityPhp database connectivity
Php database connectivity
 
Chapter 6 database normalisation
Chapter 6  database normalisationChapter 6  database normalisation
Chapter 6 database normalisation
 
Chapter 5 transactions and dcl statements
Chapter 5  transactions and dcl statementsChapter 5  transactions and dcl statements
Chapter 5 transactions and dcl statements
 
Chapter 4 functions, views, indexing
Chapter 4  functions, views, indexingChapter 4  functions, views, indexing
Chapter 4 functions, views, indexing
 
Chapter 3 stored procedures
Chapter 3 stored proceduresChapter 3 stored procedures
Chapter 3 stored procedures
 
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
Chapter 2  grouping,scalar and aggergate functions,joins   inner join,outer joinChapter 2  grouping,scalar and aggergate functions,joins   inner join,outer join
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
 
Chapter 1 introduction to sql server
Chapter 1 introduction to sql serverChapter 1 introduction to sql server
Chapter 1 introduction to sql server
 
Chapter 1 introduction to sql server
Chapter 1 introduction to sql serverChapter 1 introduction to sql server
Chapter 1 introduction to sql server
 
Microsoft holo lens
Microsoft holo lensMicrosoft holo lens
Microsoft holo lens
 
Blue brain
Blue brainBlue brain
Blue brain
 
5g
5g5g
5g
 
Aptitude skills baabtra
Aptitude skills baabtraAptitude skills baabtra
Aptitude skills baabtra
 
Gd baabtra
Gd baabtraGd baabtra
Gd baabtra
 

Recently uploaded

A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Atul Kumar Singh
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
timhan337
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
BhavyaRajput3
 

Recently uploaded (20)

A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
 

State management in ASP.net

  • 1.
  • 2. Disclaimer: This presentation is prepared by trainees of baabtra as a part of mentoring program. This is not official document of baabtra –Mentoring Partner Baabtra-Mentoring Partner is the mentoring division of baabte System Technologies Pvt . Ltd
  • 6. Why is state necessary? • The vast majority of Internet applications operate using the HTTP protocol. • HTTP is state less. – This means that each request for a page is treated as a new request by the server.
  • 7. Introduction to State Management • Remember that ASP.NET is stateless – The Web server does not keep track of past client requests • Different technologies handle the issue of statement management differently – ASP.NET is quite unique in this regard
  • 8. Types of State Management • ASP.NET offers two categories of state management – Pure client-side statement management – Server-side state management
  • 9. Client State Management • • • • • View state Control state Hidden fields Cookies Query strings
  • 10. State Management (ViewState) • • ASP.NET preserves the state of the page’s controls between post backs by packaging and encoding it within a hidden html field. This view state feature can also be used programmatically to preserve additional information between post backs for the same page Eg :- ViewState["RequestCount"] = count; int count = (int)ViewState["RequestCount"];
  • 11. Advantages & Disadvantage of View State • It consumes no server memory. • It is more hidden than Query String and Hidden Fields • Its possible to encrypt View State information. Disadvantage :– It increases the size of the page.
  • 12. State Management (ControlState) • The ControlState property allows you to persist information as like the view state. – The ControlState data is stored in hidden fields.
  • 13. Control State Application • If we create a custom control that requires view state to work properly. • We should use control state to ensure other developers don’t break your control by disabling view state.
  • 14. State Management (Hidden Fields) • Use the HiddenField control to store persisted data. • The data is stored in the Value property • It’s simple and requires no server resources
  • 15. State Management (Query Strings) • A query string can be used to submit data back to the same page or to another page through the URL. Eg :string url = "productPage.aspx?id=" + id; Response.Redirect(url); productPage.aspx int id = Convert.ToInt32(Request["id“]);
  • 16. Disadvantages of Query String • Not secured (its visible completely in the address bar to the users) • The maximum allowable length of a query string varies from browser to browser(IE only allows only 2k of url)
  • 17. State Management (Cookies) • Cookies are a client-side approach for persisting state information. • These pairs accompany both server requests and responses within the HTTP header • Eg:HttpCookie cookie = new HttpCookie("Name",txtName.Text); // Set expiry date to 1 day, 12 hours from now cookie.Expires = DateTime.Now + new TimeSpan(1, 12, 0, 0); Response.Cookies.Add(cookie);
  • 18. Cookie Limitations • While simple, cookies have disadvantages • A cookie can only be 4096 bytes in size • Most browsers restrict the total number of cookies per site • Users can refuse to accept cookies so don’t try to use them to store critical information
  • 19. Server State Management • Application state • Session state
  • 20. Session state • Session state is a server-based state mechanism that allows you to store data in a dictionary-style collection. • It is scoped to the current browser session. • That is, each user or browser session has a different session state.
  • 22. Application state • Application state is a server-stored state mechanism that allows you to store global data in a dictionary-style collection that is accessible from all pages in the Web application.
  • 23. Application state • Thus, application state is ideal for storing relatively small, frequently used sets of data that do not change from user-to-user or request to request. • Eg :Application["SiteRequestCount"] = 0; int count = (int)Application["SiteRequestCount";
  • 24. If this presentation helped you, please visit our page facebook.com/baabtra and like it. Thanks in advance. www.baabtra.com | www.massbaab.com |www.baabte.com
  • 25. Contact Us Emarald Mall (Big Bazar Building) Mavoor Road, Kozhikode, Kerala, India. Ph: + 91 – 495 40 25 550 Start up Village Eranakulam, Kerala, India. Email: info@baabtra.com NC Complex, Near Bus Stand Mukkam, Kozhikode, Kerala, India. Ph: + 91 – 495 40 25 550