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 17:     protected string GetUrl_Law(string rout_name, object ContID)
Line 18:     {
Line 19:         int Cont_ID = int.Parse(ContID.ToString());
Line 20:         RouteValueDictionary parameters = new RouteValueDictionary { { "ContID", ContID } };
Line 21:         return Page.GetRouteUrl(rout_name, parameters);

Source File: e:\hostingspaces\vithya\nac.org.kh\wwwroot\kh\ViewLawFile.aspx.cs    Line: 19

Stack Trace:


[FormatException: Input string was not in a correct format.]
   System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +13033687
   System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) +122
   System.Int32.Parse(String s) +26
   ViewLawDetail.GetUrl_Law(String rout_name, Object ContID) in e:\hostingspaces\vithya\nac.org.kh\wwwroot\kh\ViewLawFile.aspx.cs:19
   ViewLawDetail.ddlLawID_DataBound(Object sender, EventArgs e) in e:\hostingspaces\vithya\nac.org.kh\wwwroot\kh\ViewLawFile.aspx.cs:51
   System.Web.UI.WebControls.BaseDataBoundControl.OnDataBound(EventArgs e) +109
   System.Web.UI.WebControls.ListControl.PostPerformDataBindingAction() +65
   System.Web.UI.WebControls.ListControl.PerformSelect() +46
   System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +76
   System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +114
   System.Web.UI.WebControls.ListControl.OnPreRender(EventArgs e) +23
   System.Web.UI.Control.PreRenderRecursiveInternal() +90
   System.Web.UI.Control.PreRenderRecursiveInternal() +163
   System.Web.UI.Control.PreRenderRecursiveInternal() +163
   System.Web.UI.Control.PreRenderRecursiveInternal() +163
   System.Web.UI.Control.PreRenderRecursiveInternal() +163
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +906


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