Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

Linkbutton in gridview inside updatepanel not clickable in Firefox/Chrome

$
0
0

Hi

I have the below Updatepanel with first column a linkbutton which should call a modal popup. However in firefox/chrome no lick is clickable on page

 <asp:UpdatePanel ID="UpdatePanel1" runat="server">
   <ContentTemplate>
    <asp:GridView ID="GridView1" runat="server" 
        AutoGenerateColumns="False" 
        DataSourceID="OrderList" DataKeyNames="PurchaseID" >
    <Columns>
        <asp:TemplateField HeaderText="Purchase ID">
            <ItemTemplate>
                <asp:LinkButton ID="btnPurchaseDetail" runat="server" Text='<%#Eval("PurchaseID") %>' OnClick="btnPurchaseDetail_Click" CausesValidation="false" />
            </ItemTemplate>
        </asp:TemplateField>
  
        <asp:BoundField DataField="Name" HeaderText="Name" />
        <asp:BoundField DataField="Address" HeaderText="Address" />
        <asp:BoundField DataField="Country" HeaderText="Country" />
        <asp:BoundField DataField="HomePhone" HeaderText="HomePhone" />
        <asp:BoundField DataField="Email" HeaderText="Email" />
        <asp:TemplateField HeaderText="Shipped" SortExpression="Shipped">
          <%--  <EditItemTemplate>
                <asp:CheckBox ID="CheckBox1" runat="server" Checked='<%# Bind("Shipped") %>' />
            </EditItemTemplate>--%>
            <ItemTemplate>
                <asp:CheckBox ID="CheckBox1" runat="server" Checked='<%# Bind("Shipped") %>' 
                    Enabled="false" />
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField >            
            <FooterTemplate>
               <%-- <asp:LinkButton ID="btnEdit" runat="server" CommandName="Edit" Text="Edit" />--%>
            </FooterTemplate>
        </asp:TemplateField>

    </Columns>
    </asp:GridView>
    <asp:Button runat="server" ID="btnModalPopUp" Style="display: none" />
     <asp:ModalPopupExtender TargetControlID="btnModalPopUp" 
        ID="ModalPopupExtender2" runat="server"
        BackgroundCssClass="modalBackground"
        PopupControlID="divPopUp" 
        PopupDragHandleControlID="panelDragHandle"
        DropShadow="true"
        OkControlID="btnOKModalPopup"
        CancelControlID="btnCancelModalPopup" />
    <div class="popUpStyle" id="divPopUp" style="display:none;">
    <asp:Panel ID="UpdatePanel2" runat="server" CssClass="drag">
            <asp:Label ID="lblPurchaseID" runat="server"></asp:Label>
            <asp:GridView ID="GridView2" runat="server">
            </asp:GridView>                         
            <asp:Button ID="btnClose" runat="server" Text="Close" />
      
     </asp:Panel>
    </ContentTemplate>
    </asp:UpdatePanel> 


    <asp:SqlDataSource ID="OrderList" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
        
        SelectCommand="SELECT Purchase.PurchaseID, Customer.Name, Customer.Address, Customer.HomePhone, Customer.Email, Customer.Country, Purchase.Shipped FROM Purchase INNER JOIN Customer ON Purchase.CustomerID = Customer.CustomerID WHERE (Purchase.Shipped <> 'True')">
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="OrderDetails" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
        
        SelectCommand="SELECT Purchase_Detail.PurchaseID, Product.ProductName, Product.Description, Product.Price FROM Purchase_Detail INNER JOIN Product ON Purchase_Detail.ProductID = Product.ProductID WHERE (Purchase_Detail.PurchaseID = @PurchaseID)">
        <SelectParameters>
            <asp:ControlParameter ControlID="GridView1" Name="PurchaseID" 
                PropertyName="SelectedValue" />
        </SelectParameters>
    </asp:SqlDataSource>

The associated function in codebehind is 

Protected Sub btnPurchaseDetail_Click(ByVal sender As Object, ByVal e As EventArgs)
        Dim lb As LinkButton = TryCast(sender, LinkButton)
        Dim PurchaseID As String = lb.Text
        'lblCustValue.Text = custID
        ' Connection
        Dim constr As String = System.Web.Configuration.WebConfigurationManager.
        ConnectionStrings("ConnectionString").ConnectionString
        Dim sql As String = "SELECT Purchase_Detail.PurchaseID, Product.ProductName, Product.Description, Product.Price FROM Purchase_Detail INNER JOIN Product ON Purchase_Detail.ProductID = Product.ProductID WHERE (Purchase_Detail.PurchaseID = @PurchaseID)"
        Dim connection As New SqlConnection(constr)
        Dim cmd As New SqlCommand(sql, connection)
        cmd.Parameters.AddWithValue("@PurchaseID", PurchaseID)
        cmd.CommandType = CommandType.Text
        connection.Open()
        Dim dr As SqlDataReader = cmd.ExecuteReader()
        ' Bind the reader to the GridView
        ' You can also use a lighter control
        ' like the Repeater to display data
        GridView2.DataSource = dr
        GridView2.DataBind()
        connection.Close()
        ' Show the modalpopupextender
        ModalPopupExtender2.Show()

    End Sub

However the column is not clickable in firefox/chrome, but it is in IE.

When I look at one of the cells in firebug it appears to be rendering as a link

<a href="javascript:__doPostBack('ctl00$Head$GridView1$ctl02$btnPurchaseDetail','')" id="Head_GridView1_btnPurchaseDetail_0">41</a>

Any ideas as i've ben searching around but no solutions i found appeared to help?




Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>