Sponsored Ad

Monday, December 7, 2009

How to use C#(Csharp) QueryString

This is a method to pass values from one page to another page. There is limitation of passing number of bytes(characters) in QueryString and depend on browser.

Before receiving query string in a variable you need to check for null to avoid unwanted errors.

Pass QueryString:

Samplepage.aspx?name=sample string

Receive QueryString:

Code Snippet
  1. string strName;
  2. if (Request.QueryString["name"] != null)
  3. {
  4. strName = Request.QueryString["name"].toString();
  5. }

0 comments:

Post a Comment

Sponsored Ad



More Related Articles

Website Update

Recent Posts

Followers