Codechef4u is a community for computer professionals,by computer professionals,just like you; who loves sharing and helping each others,Join them
Share your post

Advantages and disadvantages of using Hidden fields.

Hidden fields technique is widely used in ASP.NET programing. Hidden fields are html input control with hidden type that store hidden data in the html.

<input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" /> 

Advantages:

 1.  They are simple to implement.
 2.  As data is cached on client side they work with Web Farms.
 3. All browsers support hidden field.
 4.  No server resources are required.

Disadvantages:

1. They can be tampered creating a security hole.

2. Page performance decreases if you store large data, as the data are stored in
pages itself.

3. `Hidden fields do not support rich structures as HTML hidden fields are only
single valued. Then you have to work around with delimiters etc to handle
complex structures.

 Below is how you will actually implement hidden field in a project

<asp:HiddenField ID="hiddenUserid" runat="server" />

Advantages and disadvantages of using Cookies

A cookie is a small bit of text that accompanies requests and pages as they go between the Web server and browser.

Advantages:

1.  No server resources are required as they are stored in client.
2. They are light weight and simple to use

Disadvantages:

1.  Most browsers place a 4096-byte limit on the size of a cookie, although support  for 8192-byte cookies is becoming more common in the new browser and client-device versions available today.

2.  Some users disable their browser or client device’s ability to receive cookies,
There by limiting the use of cookies.

3.  Cookies can be tampered and thus creating a security hole.

4.  Cookies can expire thus leading to inconsistency.
  

Below is sample code of implementing cookies

Request.Cookies.Add(New HttpCookie(“name”, “usrname”))

Benefits and limitations of using Query Strings

Benefits and limitations of using Query Strings

A query string is information sent to the server appended to the end of a page URL.

Advantages:

1. No server resources are required.
2. The query string containing in the HTTP requests for a specific URL.
3. All browsers support query strings.

Disadvantages:

1. Query string data is directly visible to user thus leading to security problems.-
Most browsers and client devices impose a 255-character limit on URL length.

2. Below is a sample “name” and “lastName” query string passed in URLhttp://www.localhost.com/Address.aspx?name=nagnath &lastName=kendre . This query string data can then be requested later by using
Request.QueryString(“name”).