prog1011
prog1011

Reputation: 3495

asp:ImageButton OnClick event not firing in IE

I am using <asp:ImageButton> inside <asp:GridView> as below shown.

Problem:

This is working fine in Chrome and FireFox, but event not firing when I used Internet Explorer.
.aspx Code

<asp:GridView ID="gvPatAppointment" EmptyDataText="No Data Found" runat="server"
     AutoGenerateColumns="false" DataKeyNames="capp_uniq_id"                                    
      OnRowDataBound="gvPatAppointment_RowDataBound" >
     <Columns>
         <asp:TemplateField HeaderStyle-CssClass="gridHeader" HeaderText="Cancel">
              <ItemTemplate>
                <asp:ImageButton BorderStyle="None" ToolTip="Cancel Appointment" ID="ImgCancel" 
                     runat="server" ImageUrl="~/App_Themes/NewTheme/images/CssImages/delete-file-icon.png" 
                     CommandArgument='<%# Eval("capp_uniq_id") %>'
                      OnClick="ImgCancel_Click"/>
              </ItemTemplate>
         </asp:TemplateField>
      </Columns>
</asp:GridView>

.aspx.cs Code

protected void ImgCancel_Click(object sender, EventArgs e)
{
    lblMessage.Text = string.Empty;
    mdpCancelAppt.Show();
    SelectedAppointment = string.Empty;
    ImageButton ImgCancel = (ImageButton)sender;
    SelectedAppointment = Convert.ToString(ImgCancel.CommandArgument.ToString());`

}

Upvotes: 2

Views: 1252

Answers (1)

शेखर
शेखर

Reputation: 17614

according to your error message

This is occurring because your submit button is an input with type="image" (As it is render as input type='image'). Therefore, coordinates are submitted with the form. Previous versions of Internet Explorer submit those coordinates as integers, but Internet Explorer 10 submits them as decimals.

There are a variety of ways to fix it. See this question and this bug report for some solutions.

Edit 1

Similar Questions

  1. Sys.WebForms.PageRequestManagerServerErrorException: Input string was not in a correct format
  2. SCRIPT5022: Sys.WebForms.PageRequestManagerServerErrorException: Input string was not in a correct format

Upvotes: 3

Related Questions