Server Error in '/' Application.

Input string was not in a correct format.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.FormatException: Input string was not in a correct format.

Source Error:


Line 8:      string sql = string.Empty;
Line 9:      //栏目分类
Line 10:     int pid = Convert.ToInt32(Request["pid"]);
Line 11:     //int pid = Convert.ToInt32(RouteData.Values["pid"]);
Line 12:     //页数

Source File: d:\vhostroot\localuser\daruhx561\www\Product.aspx    Line: 10

Stack Trace:


[FormatException: Input string was not in a correct format.]
   System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +10860347
   System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) +145
   System.Convert.ToInt32(String value) +43
   ASP.product_aspx.__Render__control1(HtmlTextWriter __w, Control parameterContainer) in d:\vhostroot\localuser\daruhx561\www\Product.aspx:10
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +268
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +8
   System.Web.UI.Page.Render(HtmlTextWriter writer) +29
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +57
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1386


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.36480