What are QueryStrings? List some of the Advantages and Disadvantages ?

 Posted by Ddd on 2/10/2011 | Category: ASP.NET Interview questions | Views: 4860 | Points: 40
Answer:

QueryString is additional information appended at the end of the URL

example:
http://www.dotnetfunda.com/post/PostExamQuestion.aspx?CSGAgreed=true

Querystring starts with ? sign

In this example: CSGAgreed: is the key of querystring
true: value of querystring
Querystring is used to transfer information from one page to another through the URL or it can be even on the same page

How we create
example:

Response.Redirect("Default2.aspx?name="+TextBox1.Text);


Advantages:
a. Supported by all the browsers
b. can be useful for executing database queries without needing textboxes
and button for entring the input and submitting
c. Easy to use.

Disadvantages:
a. All the information in querystring is visible to user not secure.
b. limited to URL length of 255 characters.


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response