• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Sql
  • php
  • C program
  • Seo

Codelack.com

  • Home
  • C++
  • networking
  • Sql server
    • what is rdbms | one to one | one to many | many to many relation-codlack
    • sql server create table
    • code rules in sql server
  • ASP.NET
    • control state in asp.net
    • cookie in asp.net
    • datalist control in asp .net
    • Using ASP.NET To Send Email
    • application state in asp.net
    • file upload control in asp.net
  • contact us
  • Data structure
    • what is Data structure
    • doubly linked list program in c
    • Array in data structure
    • circular queue in data structure
    • Linear data structure
    • Delete node at any position in singly linked list
    • dequeue in data structure
    • implementation of stack using a Linked list in data structure
    • implementation of stack using array in data structure
    • linked list algorithm
    • linked list in data structure
  • C
    • continue and break in c
    • history of c programming language
    • array program in c
    • c programming practice questions
    • enumeration in c
    • C programs with solutions
    • Characteristic of c
    • print 1 to 100 without using loop in c program
    • two single dimension 2D array in c
  • php
    • php
    • Variables in PHP
    • Scalar data types in php
    • Output function in php
    • how to use php string functions | example of string function
    • point to point configuration
    • error in php
    • Array in  php

view state in asp.net

Asp.Net uses View State to track the values in the Controls. We can add custom values to the View State also.

The ViewState in asp.net provides a dictionary object for retaining values between multiple requests for the same page.

This is the default method that the page uses to preserve page and control property values between round trips.

ASP.Net stores view state on client side in hidden field __ViewState in encrypted form.

When a page is created on web server this hidden control is populate with state of the controls and when page is posted back to server this information is retrieved and assigned to controls.

We can look at this field by looking at the source of the page i.e. by right clicking on page and selecting view source option. We do not need to worry about this as this is automatically handled by ASP.Net.

We can enable and disable view state behavior of page and its control by specifying ‘EnableViewState’ property to true and false.

We can use view state to store our own page-specific values across round trips when the page posts back to itself.

For example

if your application is maintaining user-specific information — that is, information that is used in the page but is not necessarily part of any control — we can store it in view state.
Syntax to add Value in View State Object:

ViewState[”myviewstate”]  = “Hello World”;

OR

 ViewState.Add (“myviewstate”, “Hello World”);

Syntax to Read values from ViewState Object:

String strValue = ViewState[”myviewstate”].ToString();

Advantages of using view state :-

No server resources are required:  The view state is contained in a structure within the page code.
Simple implementation:   View state does not require any custom programming to use. It is on by default to maintain state data on controls.

Enhanced security features:   The values in view state are hashed, compressed, and encoded for Unicode implementations, which provides more security than using hidden fields.

Disadvantages of using view state in aap .net are:

Performance considerations:
Because the view state is stored in the page itself, storing large values can cause the page to slow down when users display it and when they post it. This is especially relevant for mobile devices, where bandwidth is often a limitation.
Device limitations:
Mobile devices might not have the memory capacity to store a large amount of view-state data.


Potential security risks:
The view state is stored in one or more hidden fields on the page. Although view state stores data in a hashed format, it can still be tampered with. The information in the hidden field can be seen if the page output source is viewed directly, creating a potential security issue.

cookie in asp.net

Primary Sidebar

sql

  • introduction of sql
  • database management system
  • hierarchical database management system
  • what is rdbms | one to one | one to many | many to many relation-codlack
  • codd rules in sql server
  • Character Data Type
  • constraint unique
  • sql server create table

Ads

data structure

  • Data structure
  • Linear data structure
  • Array in data structure
  • What is a algorithm
  • stacks in data structure
  • queue data structure
  • dequeue in data structure
  • Priority queue
  • circular queue in data structure
  • linked list algorithm
  • Delete node in singly linked list
  • tree in data structure
  • implementation of stack using array in data structure
  • implementation of stack using a Linked list in data structure
  • Doubly Linked List Implementation

C programming

  • history of c programming language
  • C programs with solutions
  • Characteristic
  • constraint unique
  • continue and break
  • doubly linked list program in c
  • dynamic memory allocation
  • enumeration
  • print 1 to 100 without using loop
  • Variable declaration

c++

  • Introduction to C++ | similarities of  C++ structure and  class
  • default argument in c++
  • access specifiers in c++
  • Function In C++
  • friend function in c++
  • constructor in c++
  • destructor in c++ | How to call destructor C++
  • exception handling in c++

Categories

array multiplication (1) asp.net (10) B.ed (1) C# (1) c# (1) C++ (2) C program (3) FormView control (1) php (2) Seo (5) Sql (1) Uncategorized (12)
disclaimer

Copyright © 2022 · codelack.com