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 333:
Line 334:        HiddenField hlCateID = (HiddenField)e.Item.FindControl("hlCateID");
Line 335:        int catID = Convert.ToInt32(hlCateID.Value);
Line 336:        Label lbNaviCateTitle = (Label)e.Item.FindControl("lbNaviCateTitle");
Line 337:        string link = Global.root + "products/C";

Source File: d:\wwwrootV2\cyclosystem\products\brandlist.aspx.cs    Line: 335

Stack Trace:


[FormatException: Input string was not in a correct format.]
   System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +7476759
   System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) +119
   System.Convert.ToInt32(String value) +63
   products_brandlist.dlProd_OnItmeDataBound(Object sender, DataListItemEventArgs e) in d:\wwwrootV2\cyclosystem\products\brandlist.aspx.cs:335
   System.Web.UI.WebControls.DataList.OnItemDataBound(DataListItemEventArgs e) +8770710
   System.Web.UI.WebControls.DataList.CreateItem(Int32 itemIndex, ListItemType itemType, Boolean dataBind, Object dataItem) +137
   System.Web.UI.WebControls.DataList.CreateControlHierarchy(Boolean useDataSource) +459
   System.Web.UI.WebControls.BaseDataList.OnDataBinding(EventArgs e) +54
   System.Web.UI.WebControls.BaseDataList.DataBind() +55
   products_brandlist.PopulateForm(Int32 brandid) in d:\wwwrootV2\cyclosystem\products\brandlist.aspx.cs:310
   products_brandlist.PopulateBrand(Int32 brandID) in d:\wwwrootV2\cyclosystem\products\brandlist.aspx.cs:203
   products_brandlist.PopulateNavi(Int32 cateID) in d:\wwwrootV2\cyclosystem\products\brandlist.aspx.cs:183
   products_brandlist.Page_Load(Object sender, EventArgs e) in d:\wwwrootV2\cyclosystem\products\brandlist.aspx.cs:91
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627


Version Information: Microsoft .NET Framework Version:2.0.50727.8784; ASP.NET Version:2.0.50727.8762