QueryString is a property of Request object in ASP.Net that provides a mechanism to send information to the server in the form of Sting in the URL.
Example: http://www.testsite.com/Webform1.aspx?fname=Alok&lname=Ranjan
In the above example, the destination webform name is Webform1.aspx and the information passed in QueryString is fname=Alok&lname=Ranjan. fname is a variable whose value is Alok, and similarly lname variable has value as Ranjan.
Advantages of QueryString:
Disadvantages of QueryString:
Example: http://www.testsite.com/Webform1.aspx?fname=Alok&lname=Ranjan
In the above example, the destination webform name is Webform1.aspx and the information passed in QueryString is fname=Alok&lname=Ranjan. fname is a variable whose value is Alok, and similarly lname variable has value as Ranjan.
Advantages of QueryString:
- It's very easy to implement
- Every browser works with QueryString.
- It doesn't require server resources. Hence, doesn't put any burden on Server.
Disadvantages of QueryString:
- There is a limitation in the length of the QueryString as URL length has a limit. If you have to send lot of information, QueryString approach doesn't work.
- The information passed through QueryString is publicly visible. Hence, it poses security issue. So, QueryString can't be used while sending sensitive info.
- QueryString can not be used to send & and space characters.
No comments:
Post a Comment