0

I am calling ajax dropdown inside repeater with link button. DropDown list is populated in IE but that value is not being selected so ItemCommnand is not fired at all.IE is not able to understand that dropdown value is selected, same thing works fine in google

My front end code is:

  <asp:UpdatePanel ID="upPaymentRefund" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="false" EnableViewState="true" >
        <ContentTemplate>
    <div class="row">
    <div class="left heading-column">Cards on file:</div>
                                    <div class="left form-wide-column-left">
                                        <asp:Label ID="lblCardsonfile" runat="server" 
                                    Style="display:block; width:100px; padding:2px; padding-right:50px; font-family:Arial; font-size:11px;"
                                    Text="Select card on file"></asp:Label>
                                        <asp:Panel ID="panelCardsOnFile" runat="server" 
                                    CssClass="ContextMenuPanel" Style="display:none; visibility:hidden; ">
                                    <asp:Repeater ID="rptCardsOnFile" runat="server" EnableViewState="true"
                                    OnItemCommand="rptCardsOnFile_ItemCommand">
                                        <ItemTemplate>
                                            <asp:LinkButton ID="lblCardsonfile" runat="server" CausesValidation="false" style="z-index:20000"
                                                CssClass="ContextMenuItem" CommandName="Select" OnClientClick="alert('hi')"
                                                CommandArgument='<%# Eval("customerCards") %>'  
                                                Text='<%# Eval("UseInDropDown") %>' />
                                        </ItemTemplate>
                                    </asp:Repeater>
                                </asp:Panel>

                                        <cc1:DropDownExtender ID="ddeCardsOnFile" runat="server" 
                                    DropDownControlID="panelCardsOnFile" 
                                    TargetControlID="lblCardsonfile" ></cc1:DropDownExtender>


                                        <asp:HiddenField ID="hfCCInfo" Value="" runat="server" />
                                    </div>
                                </div>
</ContentTemplate>
</asp:UpdatePanel>

And I have the following event in my code behind file:

Binding repeater protected void Page_Load(object sender, EventArgs e) {

        if (!Page.IsPostBack)
        {
           using (dbUtil db = new dbUtil())
        {
            db.ConnectDB();
            SqlCommand cmd = new SqlCommand("getCustomerCards " + customerID.ToString(), db.Connection);
            SqlDataReader rdr = cmd.ExecuteReader();
            if (rdr.HasRows)
            {

                //while (rdr.Read())
                //{
                //string data = rdr["customerCards"].ToString() ;
                //string[] itemized = data.Split(new char[] { '|' });

                //}
            }
            this.rptCardsOnFile.DataSource = rdr;
            this.rptCardsOnFile.DataBind();

        }
   }
}

Repeater's ItemCommand

protected void rptCardsOnFile_ItemCommand(object source,RepeaterCommandEventArgse){

this.ddlCardType.SelectedIndex = -1;
this.ddlExpMonth.SelectedIndex = -1;
this.ddlExpYear.SelectedIndex = -1;
    }
v234
  • 1
  • 2

1 Answers1

0

this issue seems to be occuring because of lack of DOCTYPE, thus IE converting the page IE5 / IE7 compatibility mode. You can add DOCTYPE in webform like this -

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="$fileinputname$.aspx.cs" Inherits="$rootnamespace$.$classname$" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<html>
    <head runat="server">
        <title></title>
    </head>
    <body>

   </body>
</html>

If you face problem you can see this tutorial HERE

Rafat Ahmad
  • 169
  • 1
  • 10
  • this is my child page.The thing which you mentioned is already present in master page.So that's not an issue. – v234 Oct 31 '16 at 15:47