Hey guys, I've been helping a buddy of mine trying to figure out this problem with his asp.net site, basically from the admin panel you add a product and it will make the page not work, but if you delete it, it'll work fine, heres the code coming back.

Line 38:                 ((HtmlGenericControl)e.Item.FindControl("divPanel")).Attributes["class"] = "product_panel right_col";
Line 39: 
Line 40:             ((HtmlGenericControl)e.Item.FindControl("divRating")).Style["width"] = (int.Parse(drv["OurRating"].ToString()) * 15).ToString() + "px";

Line 41:
Line 42:             string avail = "";

I'm not understanding the problem, I dont know much asp.net, so be easy on me..

Heres the Stack Trace;

[FormatException: Input string was not in a correct format.]
   System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +7467783
   System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) +119
   System.Int32.Parse(String s) +23
   smokes.rptProducts_ItemDataBound(Object sender, RepeaterItemEventArgs e) in d:\Domains\theherbalhut.com\wwwroot\smokes.aspx.cs:40
   System.Web.UI.WebControls.Repeater.OnItemDataBound(RepeaterItemEventArgs e) +108
   System.Web.UI.WebControls.Repeater.CreateItem(Int32 itemIndex, ListItemType itemType, Boolean dataBind, Object dataItem) +136
   System.Web.UI.WebControls.Repeater.CreateControlHierarchy(Boolean useDataSource) +443
   System.Web.UI.WebControls.Repeater.OnDataBinding(EventArgs e) +51
   System.Web.UI.WebControls.Repeater.DataBind() +75
   smokes.Page_Load(Object sender, EventArgs e) in d:\Domains\theherbalhut.com\wwwroot\smokes.aspx.cs:20
   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

Recommended Answers

All 2 Replies

What is the value of drv["OurRating"] when that exception occurs? Interestingly enough I have never seen System.Number.StringToNumber fail before when parsing values so I looked around and it seems there is an odd bug.
http://groups.google.com/group/microsoft.public.dotnet.framework/browse_frm/thread/1e2a5a340425a67b/9eb8e300c7c60821

It links to a Microsoft feedback report:
https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=253265

Posted by Microsoft on 3/22/2007 at 1:43 PM
Thanks Michael, we now understand this bug, I'm restating it here in case someone else searches for this bug.

As you stated, the problem is that the HKEY_CURRENT_USER\Control Panel\International\sPositiveSign in the registry is completely empty. Editing this and changing it to an empty string solves the problem.

We're still trying to figure out how this got to be missing.

i have same problem any body can help?

Source Error: 


Line 134:        {
Line 135:            string tmp = ((Label)gr.Cells[3].FindControl("boekAantal")).Text;
Line 136:            price += float.Parse(gr.Cells[2].Text) * float.Parse(tmp);
Line 137:        }
Line 138:        total.Text = price.ToString();

Source File: c:\Users\Eigenaar\Documents\Visual Studio 2010\WebSites\wikibookGLvr4.1\Winkelwagentje.aspx.cs    Line: 136 

Stack Trace: 


[FormatException: Input string was not in a correct format.]
   System.Number.ParseSingle(String value, NumberStyles options, NumberFormatInfo numfmt) +9422867
   System.Single.Parse(String s) +23
   Winkelwagentje.CalculateTotal() in c:\Users\Eigenaar\Documents\Visual Studio 2010\WebSites\wikibookGLvr4.1\Winkelwagentje.aspx.cs:136
   Winkelwagentje.Page_Load(Object sender, EventArgs e) in c:\Users\Eigenaar\Documents\Visual Studio 2010\WebSites\wikibookGLvr4.1\Winkelwagentje.aspx.cs:29
   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) +91
   System.Web.UI.Control.LoadRecursive() +74
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2207

this is my code

protected void CalculateTotal()
    {
        float price = 0;
        foreach (GridViewRow gr in GridView1.Rows)
        {
            string tmp = ((Label)gr.Cells[3].FindControl("boekAantal")).Text;
            price += float.Parse(gr.Cells[2].Text) * float.Parse(tmp);
        }
        total.Text = price.ToString();
    }
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.