Asp.net programming we consider all important topic for knowledge about controls,web Services, JSON, Ajax, database, and interview related Question. In this Asp.net and sql server tutorial blog we give many examples of jquery as like How Play YouTube Video in Your Asp.net Website by URL, How to Play YouTube Videos in Asp.net by using Jquery , Jquery Change div background on mouseover in asp.net , JQuery UI Datepicker (Calendar) etc.

Saturday, August 16, 2014

Advantages and disadvantages in asp.net of QueryString

Use of QueryString:


For Sending values to another page we will use QueryStringProperty of Request Object. While searching on the net you may see URL's like

"http://www.sitename.com/welcome.aspx?firstname=Parijat&lastname=Mishra".

Need of Encoding and Decoding QueryString:

URL of QueryString should contain only ASCII characters. So if you are passing other than ASCII Characters then they need to be encoded.

  • Asp.Net Framework provides two methods for
  •  HttpServerUtility.UrlEncode
  • HttpServerUtility.UrlDecode
  • For Encoding and Decoding characters.
How to use QueryString in asp.net:

Advantages of QueryString:

  • Easy to use and Efficient Technique
  • Light weight and not consume any server resource.
  • Seo Friendly. Where user can bookmark pages easily
  • Broad Support. Almost all browsers and devices support this.


Disadvantages of QueryString:

  •  Limited Capacity: Most browsers and client and devices allow to URL Length 255 characters limit.
  • We can pass information in string format only, to pass objects and large volumes of data we have to do lot more things.
  • Security: Information send through Query String we will see this on url so the data not be secured.


QueryString Class Hierarchy;

  • System.Object 
  • System.Web.UI.WebControls.Parameter
  • System.Web.UI.WebControls.QueryStringParameter

QueryString Constructors:

QueryStringParameter()
Initializes a new unnamed instance of the QueryStringParameter class.

QueryString Lazy way: 

QueryString is not filled in a lazy way. By the time your HttpRequest is being used, QueryString hasbeen initialized with all the  key-values.

Other Related Post :


No comments:

Post a Comment