如http://localhost/detail.aspx?id=12
我在这个detail.aspx.cs页面Request.QueryString["id"]
如何判断Request.QueryString["id"]为整数?

解决方案 »

  1.   

    if (isNumeric(Request.QueryString["id"])&&Request.QueryString["id"].IndexOf(".
    ")!=-1))
    ........
      

  2.   

    http://www.cnblogs.com/hbifts/archive/2004/09/10/15732.aspx
      

  3.   

    http://jsp.mobikom.com/stoyan/blog/PermaLink.aspx?guid=d175dedc-717b-4616-ae33-94bb71cdb372
      

  4.   

    偷懒的方法:
    bool IsInt(string str)
    {
        try{ Int32.Parse(str);return true; }
        catch{ return false; }
    }
      

  5.   


    bool IsInt(string str)
    {
        try{ Int32.Parse(str);return true; }
        catch{ return false; }
    }
    是C#的呀