How to retrieve value from query string using C# and Asp.Net

 

History

In the Previous articles i explained allow only alpha numeric values in a textbox using asp.nethow to create cms website using c# and asp.nethow to sell products online through my websitehow to create setup of visual studio windows application with database, how to add paging in gridview of asp.net and many more about ASP.Net.

Introduction

Today i will tell you how to retrieve value from query string using C# and ASP.Net.

A Query String is information that is appended to the end of a pafe URL. A typical query string might look like the following example :

http://www.stepcoder.com/mypage.aspx?category=basic&price=500

In this URL path, the query string starts with the question mark (?) and includes two attribute-value pairs, oe called category and other called price.

Query String provide a simple but limited way of maintaing state information. For example, they are an easy way to pass information from one page to another, such as passing a product number from one page to another page where it will be processed. However, some browsers and client devices impose a 255-character limit on the length of the URL.

Example

Suppose you want to get value from query string "Title".

You can use Below Code :

 Request.QueryString["Title"];

 

Give your Valuable Comments.
comments powered by Disqus
 
Follow me on twitter
About Me
Harpreet Singh
I began programming with C++ when i was 17. Then at the middle of my study .NET came. Then I began to read C# and VB.NET. By the time i learnt SQL and ASP.NET, and developed some websites such as news portals that are active now. Currently i am running my own Software company.
More Articles