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 186:                                                <asp:TemplateField SortExpression="id">
Line 187:                                                    <ItemTemplate>
Line 188:                                                        <span class="price"><%# string.Format("{0:N0}", Convert.ToInt32(pricee(Eval("id").ToString()))) %> تومان</span>
Line 189:                                                    </ItemTemplate>
Line 190:                                                    <ItemStyle HorizontalAlign="Right" />

Source File: c:\inetpub\vhosts\mehmanstore.com\httpdocs\productdetails.aspx    Line: 188

Stack Trace:


[FormatException: Input string was not in a correct format.]
   System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +14542174
   System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) +174
   System.Convert.ToInt32(String value) +64
   ASP.productdetails_aspx.__DataBind__control25(Object sender, EventArgs e) in c:\inetpub\vhosts\mehmanstore.com\httpdocs\productdetails.aspx:188
   System.Web.UI.Control.OnDataBinding(EventArgs e) +100
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +178
   System.Web.UI.Control.DataBindChildren() +248
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +195
   System.Web.UI.Control.DataBindChildren() +248
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +195
   System.Web.UI.WebControls.GridView.CreateRow(Int32 rowIndex, Int32 dataSourceIndex, DataControlRowType rowType, DataControlRowState rowState, Boolean dataBind, Object dataItem, DataControlField[] fields, TableRowCollection rows, PagedDataSource pagedDataSource) +247
   System.Web.UI.WebControls.GridView.CreateChildControls(IEnumerable dataSource, Boolean dataBinding) +5190
   System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data) +97
   System.Web.UI.WebControls.GridView.PerformDataBinding(IEnumerable data) +19
   System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) +208
   productdetails.pricee() in c:\inetpub\vhosts\mehmanstore.com\httpdocs\productdetails.aspx.cs:197
   productdetails.Page_Load(Object sender, EventArgs e) in c:\inetpub\vhosts\mehmanstore.com\httpdocs\productdetails.aspx.cs:145
   System.Web.UI.Control.OnLoad(EventArgs e) +108
   System.Web.UI.Control.LoadRecursive() +90
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1533


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