How to use C#(Csharp) QueryString
Sponsored Ad
Monday, December 7, 2009
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
- string strName;
- if (Request.QueryString["name"] != null)
- {
- strName = Request.QueryString["name"].toString();
- }
0 comments:
Subscribe to:
Post Comments (Atom)