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 22:             ddl_Category.DataSource = category.CategoryTable;
Line 23:             ddl_Category.DataBind();
Line 24:             double categoryID = Convert.ToDouble(RouteData.Values["category_id"]);
Line 25:             if (categoryID <= 0)
Line 26:                 ddl_Category.SelectedIndex = 7;

Source File: C:\Inetpub\vhosts\adebooking.com\httpdocs\SearchPackage.aspx.cs    Line: 24

Stack Trace:


[FormatException: Input string was not in a correct format.]
   System.Number.ParseDouble(String value, NumberStyles options, NumberFormatInfo numfmt) +12933692
   System.String.System.IConvertible.ToDouble(IFormatProvider provider) +46
   System.Convert.ToDouble(Object value) +30
   SearchPackage.GetCategory() in C:\Inetpub\vhosts\adebooking.com\httpdocs\SearchPackage.aspx.cs:24
   SearchPackage.Page_Load(Object sender, EventArgs e) in C:\Inetpub\vhosts\adebooking.com\httpdocs\SearchPackage.aspx.cs:54
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +85
   System.Web.UI.Control.OnLoad(EventArgs e) +79
   System.Web.UI.Control.LoadRecursive() +130
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2857


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