SlideShare una empresa de Scribd logo
1 de 21
 
? Why State Management?
[object Object],[object Object],[object Object],Why State Management?
What is State Management?
What is State Management? ,[object Object],[object Object],[object Object]
Different Ways to Manage State? ,[object Object],[object Object]
Client-side State Management There is no information maintained on the server between round trips. Information will be stored in the page or on the client’s computer With Help Of .. ,[object Object],[object Object],[object Object],[object Object],[object Object]
Server-side State Management ,[object Object],[object Object],[object Object],[object Object],Information will be stored on the server, it has higher security but it can use more web server resources.
Client-side State Management Query Strings What are Query Strings? Query strings  are data that is appended to the end of a page URL. They are commonly used to hold  String data like page numbers or  search terms or other data that isn't confidential. The user can see  the values which the  query string  holds without using special  operations. An example of a  query string  can look like  http://www.Student.co.il?a=1;b=2.  The Query String Structure As written earlier,  query strings  are appended to the end of a URL. First a question mark is appended to the URL's end and then every parameter that we want to hold in the  query string . The parameters  declare the parameter name followed by = symbol which followed by  the data to hold. Every parameter is separated with the ampersand  symbol(&).
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],How To Use Query Strings When you need to use a query string data you do it in the following way:          string queryStringData = Request.QueryString["data"]; Query Strings Client-side State Management
Client-side State Management Hidden Field What are Hidden Fields ? A hidden field does not render visibly in the browser, but you can set its  properties just as you can with a standard control. When a page is submitted  to the server, the content of a hidden field is sent in the HTTP Form collection  along with the values of other controls. A hidden field  acts as a repository for  any page-specific information that you would like  to store directly in the page.  Hidden field stores a single variable in its  value  property and must be  explicitly added it to the page.ASP.NET  provides the  HtmlInputHidden  control  that offers hidden field functionality.  Hidden Fields Values     Hidden fields  store only one value in their  value property.  The value is  saved  as a  string  and therefore in order to use it for other  types you  need to perform casting. You can see the stored data easily by using the  View Source operation of the browser. You can see it by clicking the right  mouse button and then choosing View Source from the  menu (if the  operation is available). The values has page context and  therefore when  you leave a page the data stored in the  hidden fields  is  disposed.
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],How To Use Hidden Field  protected System.Web.UI.HtmlControls.HtmlInputHidden Hidden1; //to assign a value to Hidden field Hidden1.Value=”this is a test”; //to retrieve a value  string str=Hidden1.Value;
Cookies Client-side State Management What are Cookies? A  cookie  is a piece of data that is saved either in the memory  of the client’s  web browser or as a text file in the file system of  the client.  Cookies  are used to identify a user, to store state  information, preferences of the user and etc. How Does Cookies Mechanism Work? The mechanism of  cookies  is simple. When a client request  a web page from a server the first request isn't containing a  cookie . The server identify that the client has no  cookie  and  generate . Then the server sends the  cookie  to the client and  from now on the client will send the  cookie  in every request  and the server will send the  cookie  in every response.
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Cookies Limitations The clients can disable  cookies . One way to check if  cookies  are disabled is to write a  cookie  to the  Response  and in the next  Request  to check if the  cookie  exists. If the  cookie  doesn't exists you need to assume that  cookies  are disabled.  ,[object Object],[object Object],[object Object],[object Object],Cookies Advantage ,[object Object],[object Object],[object Object]
View State Client-side State Management What is View State? ViewSate  is a technique to preserve controls data and maintain  their properties during multiple requests for the same page  how, the ViewState property provides a dictionary object for  retaining values between multiple requests for the same page.  When an ASP.NET page is processed, the current state of the  page and controls is hashed into a string and saved in the page  as a hidden filed. How to use View State? You can use the ViewState property of the Control or Page  class to add values to View State. The ViewState property  exposes a dictionary of key and value pairs. For example, the  following statement adds the string Hello World! to View State: ViewState(“message”) = “Hello World!”
View State Limitations ,[object Object],[object Object],View State Advantage ,[object Object],[object Object]
 
Questions?
Further references Online http://www.oodesign.com http://www.programmersheaven.com  http://www.dofactory.com  Books

Más contenido relacionado

La actualidad más candente

state managment
state managment state managment
state managment
aniliimd
 
State management 1
State management 1State management 1
State management 1
singhadarsh
 

La actualidad más candente (20)

Chapter 8 part1
Chapter 8   part1Chapter 8   part1
Chapter 8 part1
 
state managment
state managment state managment
state managment
 
06 asp.net session08
06 asp.net session0806 asp.net session08
06 asp.net session08
 
State management
State managementState management
State management
 
Managing states
Managing statesManaging states
Managing states
 
ASP.NET Lecture 4
ASP.NET Lecture 4ASP.NET Lecture 4
ASP.NET Lecture 4
 
ASP.NET 12 - State Management
ASP.NET 12 - State ManagementASP.NET 12 - State Management
ASP.NET 12 - State Management
 
State management 1
State management 1State management 1
State management 1
 
Csphtp1 20
Csphtp1 20Csphtp1 20
Csphtp1 20
 
Step by Step Asp.Net GridView Tutorials
Step by Step Asp.Net GridView TutorialsStep by Step Asp.Net GridView Tutorials
Step by Step Asp.Net GridView Tutorials
 
IEEE KUET SPAC presentation
IEEE KUET SPAC  presentationIEEE KUET SPAC  presentation
IEEE KUET SPAC presentation
 
C sharp and asp.net interview questions
C sharp and asp.net interview questionsC sharp and asp.net interview questions
C sharp and asp.net interview questions
 
Session viii(state mngtserver)
Session viii(state mngtserver)Session viii(state mngtserver)
Session viii(state mngtserver)
 
Search engine optimization (seo) from Endeca & ATG
Search engine optimization (seo) from Endeca & ATGSearch engine optimization (seo) from Endeca & ATG
Search engine optimization (seo) from Endeca & ATG
 
ASP session object
ASP session objectASP session object
ASP session object
 
Oracle Endeca Developer's Guide
Oracle Endeca Developer's GuideOracle Endeca Developer's Guide
Oracle Endeca Developer's Guide
 
Securing the Web@VoxxedDays2017
Securing the Web@VoxxedDays2017Securing the Web@VoxxedDays2017
Securing the Web@VoxxedDays2017
 
Query Store and live Query Statistics
Query Store and live Query StatisticsQuery Store and live Query Statistics
Query Store and live Query Statistics
 
Vb & asp .net
Vb & asp .netVb & asp .net
Vb & asp .net
 
MICROSOFT ASP.NET ONLINE TRAINING
MICROSOFT ASP.NET ONLINE TRAININGMICROSOFT ASP.NET ONLINE TRAINING
MICROSOFT ASP.NET ONLINE TRAINING
 

Similar a State management

19_JavaScript - Storage_Cookies_students.pptx
19_JavaScript - Storage_Cookies_students.pptx19_JavaScript - Storage_Cookies_students.pptx
19_JavaScript - Storage_Cookies_students.pptx
VatsalJain39
 
High performance coding practices code project
High performance coding practices code projectHigh performance coding practices code project
High performance coding practices code project
Pruthvi B Patil
 
0_Leksion_Web_Servers (1).pdf
0_Leksion_Web_Servers (1).pdf0_Leksion_Web_Servers (1).pdf
0_Leksion_Web_Servers (1).pdf
Zani10
 

Similar a State management (20)

State Management.pptx
State Management.pptxState Management.pptx
State Management.pptx
 
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 in ASP.net
State  management in ASP.netState  management in ASP.net
State management in ASP.net
 
Enterprise java unit-2_chapter-3
Enterprise  java unit-2_chapter-3Enterprise  java unit-2_chapter-3
Enterprise java unit-2_chapter-3
 
ASP.NET Lecture 2
ASP.NET Lecture 2ASP.NET Lecture 2
ASP.NET Lecture 2
 
Session viii(state mngtclient)
Session viii(state mngtclient)Session viii(state mngtclient)
Session viii(state mngtclient)
 
StateManagement in ASP.Net.ppt
StateManagement in ASP.Net.pptStateManagement in ASP.Net.ppt
StateManagement in ASP.Net.ppt
 
Ch05 state management
Ch05 state managementCh05 state management
Ch05 state management
 
19_JavaScript - Storage_Cookies_students.pptx
19_JavaScript - Storage_Cookies_students.pptx19_JavaScript - Storage_Cookies_students.pptx
19_JavaScript - Storage_Cookies_students.pptx
 
session and cookies.ppt
session and cookies.pptsession and cookies.ppt
session and cookies.ppt
 
High performance coding practices code project
High performance coding practices code projectHigh performance coding practices code project
High performance coding practices code project
 
Session And Cookies In Servlets - Java
Session And Cookies In Servlets - JavaSession And Cookies In Servlets - Java
Session And Cookies In Servlets - Java
 
WEB Mod5@AzDOCUMENTS.in.pdf
WEB Mod5@AzDOCUMENTS.in.pdfWEB Mod5@AzDOCUMENTS.in.pdf
WEB Mod5@AzDOCUMENTS.in.pdf
 
State management in asp.net
State management in asp.netState management in asp.net
State management in asp.net
 
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 4...
 Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 4... Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 4...
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 4...
 
Server side programming bt0083
Server side programming bt0083Server side programming bt0083
Server side programming bt0083
 
WEB MODULE 5.pdf
WEB MODULE 5.pdfWEB MODULE 5.pdf
WEB MODULE 5.pdf
 
ASP.NET 04 - Additional Web Server Controls
ASP.NET 04 - Additional Web Server ControlsASP.NET 04 - Additional Web Server Controls
ASP.NET 04 - Additional Web Server Controls
 
Session,cookies
Session,cookiesSession,cookies
Session,cookies
 
0_Leksion_Web_Servers (1).pdf
0_Leksion_Web_Servers (1).pdf0_Leksion_Web_Servers (1).pdf
0_Leksion_Web_Servers (1).pdf
 

Más de Lalit Kale

Más de Lalit Kale (20)

Serverless microservices
Serverless microservicesServerless microservices
Serverless microservices
 
Develop in ludicrous mode with azure serverless
Develop in ludicrous mode with azure serverlessDevelop in ludicrous mode with azure serverless
Develop in ludicrous mode with azure serverless
 
For Business's Sake, Let's focus on AppSec
For Business's Sake, Let's focus on AppSecFor Business's Sake, Let's focus on AppSec
For Business's Sake, Let's focus on AppSec
 
Introduction To Microservices
Introduction To MicroservicesIntroduction To Microservices
Introduction To Microservices
 
Dot net platform and dotnet core fundamentals
Dot net platform and dotnet core fundamentalsDot net platform and dotnet core fundamentals
Dot net platform and dotnet core fundamentals
 
Code refactoring
Code refactoringCode refactoring
Code refactoring
 
Application Security Tools
Application Security ToolsApplication Security Tools
Application Security Tools
 
Threat Modeling And Analysis
Threat Modeling And AnalysisThreat Modeling And Analysis
Threat Modeling And Analysis
 
Application Security-Understanding The Horizon
Application Security-Understanding The HorizonApplication Security-Understanding The Horizon
Application Security-Understanding The Horizon
 
Coding guidelines
Coding guidelinesCoding guidelines
Coding guidelines
 
Code review guidelines
Code review guidelinesCode review guidelines
Code review guidelines
 
Implementing application security using the .net framework
Implementing application security using the .net frameworkImplementing application security using the .net framework
Implementing application security using the .net framework
 
Data normailazation
Data normailazationData normailazation
Data normailazation
 
Opps
OppsOpps
Opps
 
Versioning guidelines for product
Versioning guidelines for productVersioning guidelines for product
Versioning guidelines for product
 
Bowling Game Kata by Robert C. Martin
Bowling Game Kata by Robert C. MartinBowling Game Kata by Robert C. Martin
Bowling Game Kata by Robert C. Martin
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
Web 2.0 concept
Web 2.0 conceptWeb 2.0 concept
Web 2.0 concept
 
Jump Start To Ooad And Design Patterns
Jump Start To Ooad And Design PatternsJump Start To Ooad And Design Patterns
Jump Start To Ooad And Design Patterns
 
How To Create Strategic Marketing Plan
How To Create Strategic Marketing PlanHow To Create Strategic Marketing Plan
How To Create Strategic Marketing Plan
 

Último

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Último (20)

Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 

State management

  • 1.  
  • 2. ? Why State Management?
  • 3.
  • 4. What is State Management?
  • 5.
  • 6.
  • 7.
  • 8.
  • 9. Client-side State Management Query Strings What are Query Strings? Query strings are data that is appended to the end of a page URL. They are commonly used to hold String data like page numbers or search terms or other data that isn't confidential. The user can see the values which the query string holds without using special operations. An example of a query string can look like http://www.Student.co.il?a=1;b=2. The Query String Structure As written earlier, query strings are appended to the end of a URL. First a question mark is appended to the URL's end and then every parameter that we want to hold in the query string . The parameters declare the parameter name followed by = symbol which followed by the data to hold. Every parameter is separated with the ampersand symbol(&).
  • 10.
  • 11. Client-side State Management Hidden Field What are Hidden Fields ? A hidden field does not render visibly in the browser, but you can set its properties just as you can with a standard control. When a page is submitted to the server, the content of a hidden field is sent in the HTTP Form collection along with the values of other controls. A hidden field acts as a repository for any page-specific information that you would like to store directly in the page. Hidden field stores a single variable in its value property and must be explicitly added it to the page.ASP.NET provides the HtmlInputHidden control that offers hidden field functionality. Hidden Fields Values Hidden fields store only one value in their value property. The value is saved as a string and therefore in order to use it for other types you need to perform casting. You can see the stored data easily by using the View Source operation of the browser. You can see it by clicking the right mouse button and then choosing View Source from the menu (if the operation is available). The values has page context and therefore when you leave a page the data stored in the hidden fields is disposed.
  • 12.
  • 13. Cookies Client-side State Management What are Cookies? A cookie is a piece of data that is saved either in the memory of the client’s web browser or as a text file in the file system of the client. Cookies are used to identify a user, to store state information, preferences of the user and etc. How Does Cookies Mechanism Work? The mechanism of cookies is simple. When a client request a web page from a server the first request isn't containing a cookie . The server identify that the client has no cookie and generate . Then the server sends the cookie to the client and from now on the client will send the cookie in every request and the server will send the cookie in every response.
  • 14.
  • 15.
  • 16.
  • 17. View State Client-side State Management What is View State? ViewSate is a technique to preserve controls data and maintain their properties during multiple requests for the same page how, the ViewState property provides a dictionary object for retaining values between multiple requests for the same page. When an ASP.NET page is processed, the current state of the page and controls is hashed into a string and saved in the page as a hidden filed. How to use View State? You can use the ViewState property of the Control or Page class to add values to View State. The ViewState property exposes a dictionary of key and value pairs. For example, the following statement adds the string Hello World! to View State: ViewState(“message”) = “Hello World!”
  • 18.
  • 19.  
  • 21. Further references Online http://www.oodesign.com http://www.programmersheaven.com http://www.dofactory.com Books