Posted By

krisdb on 02/19/09


Tagged

c-sharp


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

umang_nine
ddevening
LeeRJohnson


QueryString check


 / Published in: C#
 

  1. string id = (!string.IsNullOrEmpty(Request.QueryString["id"])) ? Request.QueryString["id"] : String.Empty;
  2.  
  3. if (id.Length > 0)
  4. {
  5.  
  6. }
  7.  
  8.  
  9. int id= (!string.IsNullOrEmpty(Request.QueryString["id"])) ? Convert.ToInt32(Request.QueryString["id"]) : 0;
  10.  
  11. if (id > 0)
  12. {
  13.  
  14. }

Report this snippet  

You need to login to post a comment.