Frequently Asked Interview Questions

Interview Question on Query Strings in ASP.NET

Interview Question on QueryStrings
A Query String is information that is appended to the end of a page URL. Query strings provide a simple and limited way to maintain state information.
We can send data from one page to other page by appending that data to the URL

For Example:

To send ProductId information from page to other
Order.aspx?ProductId=100
Use “&” symbol to separate multiple query string values, If we want to send ProductId and ProductName info
Order.aspx? ProductId=100 & ProductName=’xxxx’
We can send Query strings from server side code using Response.Redirect
For Ex:
Response.Redirect(“Order.aspx?ProductId=100 & ProductName = ’xxxx’”);
  1. Simple implementation
  2. Does not require server resources
  3. Almost all browsers and client devices support using query strings to pass
  1. Query strings are insecure because the information in the query string is directly visible to the user on the address line in the browser.
  2. Limited capacity: Some browsers and client devices impose a 2083-character limit on the length of URLs.

Most Visited Pages

Home | Site Index | Contact Us