Click here to Skip to main content
15,885,366 members
Please Sign up or sign in to vote.
4.80/5 (2 votes)
Hi Experts,

In IE10, image buttons present within update panel, postback requests are not processing on the server.
Throwing an exception:


Message: Input string was not in a correct format.Occured at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
at System.Web.UI.WebControls.ImageButton.LoadPostData(String postDataKey, NameValueCollection postCollection)
at System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackDataHandler.LoadPostData(String postDataKey, NameValueCollection postCollection)
at System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)



I m using .net framework 2.0, I had solution for this issue by integrating a meta tag, but i dont want use the following meta tag:
<meta http-equiv="X-UA-Compatible" content="IE=9" />


Please help me, i will appreciate you.
Posted
Updated 10-Dec-13 4:56am
v2
Comments
Tom Marvolo Riddle 10-Dec-13 0:45am    
Post your code

ASP.NET
<asp:updatepanel id="UpdatePanel1" height="100px" scrollbars="Horizontal" runat="server" updatemode="Conditional" xmlns:asp="#unknown">
       <contenttemplate>

<asp:updateprogress id="upprogpnl" runat="server" associatedupdatepanelid="UpdatePanel1">


   </asp:updateprogress>
       </contenttemplate>
       <triggers>

      <asp:postbacktrigger controlid="ImageButton1" />
       </triggers>
        </asp:updatepanel>

Use Triggers
This will help You
 
Share this answer
 
v2
Hi Argeraju,

The error you have mentioned above seems to be not related to image button, you trying to pass empty value to some function to convert it into string/number.
So I would suggest you to debug the solution and check the input parameter to that particular function.

Out of curious, could you able to run the same function in other browsers?

It will be more clean if you have posted code, please update the code with your question.

I hope this helps you a bit.

Regards,
RK
 
Share this answer
 
v2
After making lot of R & D on this topic i found a perfect solution for image buttons( present within the update panel) post back request problem.

There are many knows issues with IE 10 and IE 11 , Microsoft released different hotfixes to solve that problem , but it doesnt work for me.

This is the perfect solution for .net framework 2.0 and above version applications

Need to override the LoadPostData method within a class which inherits the properties of imagebutton class, means you have to create a custom class for image button control.


C#
protected override bool LoadPostData(string postDataKey, NameValueCollection postCollection)
        {
            // Control coordinates are sent in decimal by IE10
            // Recreating the collection with corrected values
            NameValueCollection modifiedPostCollection = new NameValueCollection();
            for (int i = 0; i < postCollection.Count; i++)
            {
                string actualKey = postCollection.GetKey(i);
                string[] actualValueTab = postCollection.GetValues(i);
                if (actualKey.EndsWith(".x") || actualKey.EndsWith(".y"))
                {
                    string value = actualValueTab[0];
                    decimal dec;
                    Decimal.TryParse(value, out dec);
                    modifiedPostCollection.Add(actualKey, ((int)Math.Round(dec)).ToString());
                }
                else
                {
                    foreach (string actualValue in actualValueTab)
                    {
                        modifiedPostCollection.Add(actualKey, actualValue);
                    }
                }
            }
            return base.LoadPostData(postDataKey, modifiedPostCollection);
        }
 
Share this answer
 
v2
hai,
use
if (!IsPostBack)
in page load
 
Share this answer
 
kkkkkllllllllllll
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900