This is a migrated thread and some comments may be shown as answers.

input string not in correct format (only in Firefox)

9 Answers 331 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Amanda
Top achievements
Rank 2
Amanda asked on 30 Mar 2009, 04:48 PM
   I'm not exactly sure if this is a Rad control issue or not, but i'm thinking it is because the error started occurring after I added a rad grid to the program.  I have a web page that has several controls in it, including an ajax manager/loading panel.  the user adds an item number and when the add button is clicked, the manager is activated and it adds the item number to a grid (asp:GridView).  Everything works fine with that.  I just added a RadGrid and when a submit button (not the add button) is clicked, it sends out a url, which brings back info and enters that info into the rad grid. This is working just fine when using most internet browsers.  When I use Firefox with this, it's erroring out, almost like it's not even reaching my code.  here's the page i get:

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:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[FormatException: Input string was not in a correct format.]
   System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +7469351
   System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) +119
   System.Web.UI.WebControls.ImageButton.LoadPostData(String postDataKey, NameValueCollection postCollection) +193
   System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackDataHandler.LoadPostData(String postDataKey, NameValueCollection postCollection) +14
   System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad) +693
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1743


Version Information: Microsoft .NET Framework Version:2.0.50727.3082; ASP.NET Version:2.0.50727.3082

Any possibly information would be greatly appreciated.  Thanks!

9 Answers, 1 is accepted

Sort by
0
Yulia
Top achievements
Rank 1
answered on 03 Apr 2009, 03:47 PM

Amanda,

I had exactly the same problem this week. I searched the forum extensively and it seems like everybody who was having this problem was advised to purchase an upgrade of telerik controls. :) I really did not want to go that route.

I found a solution that worked for me.

Please check your ExpandCollapseColumn-ButtonType in MasterTableView tag. If you have this:

    ExpandCollapseColumn-ButtonType="ImageButton"

change it to this:

    ExpandCollapseColumn-ButtonType="LinkButton"

if you don't have it at all, then add ExpandCollapseColumn-ButtonType="LinkButton". (When you don't specify it, the default one is ExpandCollapseColumn-ButtonType="ImageButton").

Changing "ImageButton" to "LinkButton" removed an unneseccary postback and as a result the data is now being pulled without throwing an exception.

Please let me know if it fixed the problem for you.

Thank you!

Yulia

0
Amanda
Top achievements
Rank 2
answered on 03 Apr 2009, 04:42 PM
That actually did not work for me, but thanks for the input.  i appreciate it!
0
Sebastian
Telerik team
answered on 06 Apr 2009, 07:04 AM
Hello guys,

Indeed if you migrate to the latest versions of the RadControls for ASP.NET or ASP.NET AJAX (Q1 2009 SP1) the issue under FireFox should be addressed. It appeared with version 3.0 of the browser and was fixed shortly after that by our developers in the subsequent release of the controls.
 
Best regards,
Sebastian
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0
Amanda
Top achievements
Rank 2
answered on 06 Apr 2009, 07:28 PM
so do i have to physically swap out all the controls on my pages now that i've upgraded to the latest version of rad controls?
0
Vinay
Top achievements
Rank 1
answered on 21 Jan 2010, 02:12 PM
Thank you! Changing the ButtonType="LinkButton" fixed the issue in firefox.

0
Accepted
Mark Herried
Top achievements
Rank 1
answered on 13 May 2010, 09:57 PM

OnClientClick

 

="this.disabled=true;"

 

 

 

 

 

  Add this to the image button.  For some reason Firefox does double postbacks.  I have experienced this problem in older versions of telerik.  This happened when an image button was in a panel and a repeater surrounded by an Radajaxpanel.

0
Amanda
Top achievements
Rank 2
answered on 14 May 2010, 01:26 PM
Wow, thank you so much!!  Crazy how something so simple makes a huge difference.  This did the trick for me!
0
Amanda
Top achievements
Rank 2
answered on 14 May 2010, 03:29 PM
Okay, so I take this back partly.  Yes, "this.disabled=true" does allow Firefox to run the code smoothly, the problem is that the users many times will need to click this button again (to add more items to the grid).  When I have this snippet of code in there so Firefox runs, the button is disabled after it's clicked the first time.  So, my users can't add those extra items they need.  Is there a way that I can enable it after it's clicked or another way to have Firefox not postback twice?
0
Amanda
Top achievements
Rank 2
answered on 14 May 2010, 05:01 PM
I finally found a work around.  While looking for solutions, it seems like the problem occurs when I use an image button.  So, I added a link button and instead of using text, i used an image.  This works with IE and Firefox and users can add as many items as they'd like to my grid.  Here's an example of what I was using before that wouldn't work:

<asp:ImageButton ID="butAdd" runat="server" ImageUrl="Images/Other/add_24.gif"   
            AlternateText="Add Item" Height="24px" ImageAlign="Bottom"   
            onclientclick="this.disabled=true" Visible="False" /> 

And here's what I changed it to so it does work:

<asp:LinkButton ID="LinkButton1"   
            runat="server"><img src="Images/Other/add_24.gif" border=0 title="Add item" /></asp:LinkButton> 
Tags
General Discussions
Asked by
Amanda
Top achievements
Rank 2
Answers by
Yulia
Top achievements
Rank 1
Amanda
Top achievements
Rank 2
Sebastian
Telerik team
Vinay
Top achievements
Rank 1
Mark Herried
Top achievements
Rank 1
Share this question
or