Reputation: 2052
Hi I am getting the error
"Sys.WebForms.PageRequestManagerServerErrorException: Input string was not in a correct format."
When pressing a delete button. But this error comes only in one web server. In other server it works fine. Again when locally running the application, there is no error but it will not firing the delete action. Any Idea??
Upvotes: 4
Views: 16188
Reputation: 180
i know this is old question, but for people who will come here in future and read this, I will describe how I solved it.
My application was working for several years without problems and suddenly clients started to notice 'forewer waiting', page not refreshing because of above mentioned error (Uncaught Sys.WebForms.PageRequestManagerServerErrorException: Input string was not in a correct format.)
I had hard time to discover what was main problem because there was no error while debugging .cs code. After searching a lot I discovered that someone proposed to disable PartialRendering... (you can do it in .cs by ScriptManager1.EnablePartialRendering = false; or in page by adding EnablePartialRendering="false")
So I disabled it, and voila... finally while debugging, error appeared in one function, and executiuon stopped like before but with more description. Cool, now I know where is enemy :-) It is interesting that it wasn't hit at all while EnablePartialRendering is true. Now execution wasn't stopped in Code Behind too, but finally some more text in browser window, this is what I got:
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 1209: Array.ConvertAll<DataRow, double>(
Line 1210: dt.Select(),
Line 1211: delegate (DataRow row) { return Convert.ToDouble(row[columnName].ToString()); }
Line 1212: );
Line 1213: return GetMedianFromArray(values);
Problem was in Line: 1211
Upvotes: 0
Reputation: 5300
if the delete image button and you don't need to install the .Net framework 4.5. All the time we are not able to change the framework versions. If we have window server 2003 r2 then we can't install the .Net framework 4.5. So in this case we can change the Image button to Link button. Here is the same source for link button to show as like image button in the asp.net
<asp:LinkButton ID="deleterow" runat="server"
CommandArgument='<%#DataBinder.Eval(Container.DataItem,"Id")+","+DataBinder.Eval(Container.DataItem,"Facultykey") %>'
OnCommand="DeleteFaculty"
Visible='<%# EnableControls(DataBinder.Eval(Container.DataItem , "IsFacultyConfirmed"),2,DataBinder.Eval(Container.DataItem , "AFTId"),DataBinder.Eval(Container.DataItem , "FacultyKey"))%>' >
<asp:Image ID="Delete"
ImageUrl="../App_Themes/Blue/images/buttons/delete.gif"
runat="server"/></asp:LinkButton>
Since i personally suffer having windows server 2003 R2 and unable to install the .Net framework 4.5 and it will helps to solve the issue without touching the server config.
Hope this helps
Upvotes: 0
Reputation: 31
Found elsewhere the suggestion to use an Image inside a Linkbutton.
Works well. ImageButtons inside Gridviews especially within update panels were always a pain.
http://forums.asp.net/t/1823287.aspx/2/10 Re: ImageButtons not working in IE10
Dec 05, 2012 04:38 PM|LINK
I couldn't get any of the above example to work for me, but I have an Image Button in a repeater within an update panel. Anyway, I just replaced the Image Button with a Link Button wrapping an Image and everything is working again.
Upvotes: 3
Reputation: 2052
Yes... This issue was solved by updating the .net framework to 4.5. The issue was with the framework with IE 10. Please check your server .net framework and Your local PC as well.
Just simply update the framework. I couldn't find any other solutions rather than this. :)
Upvotes: 2