Click here to Skip to main content
15,881,803 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi I have a modal pop up extender and this is hide popup .i take a gridview in Popup . But no event fire OnRowcommand .Following aspx

ASP.NET
<pre lang="xml"><asp:Panel ID="pnlPopup" runat="server" Width="700" Style="display: none;" >
                                <div id="divSimplePopup" class="popup">
                                <div class="headerpop" runat="server" id="aa">
                                    <span id="lblPopupHeader" class="msg">Requisition</span>
                                </div>

                                    <asp:UpdatePanel ID="upDatePanl" runat="server" UpdateMode="Conditional">
                                        <ContentTemplate>
                                            <asp:Button ID="btnShowPopup" runat="server" Text="Button" Style="display: none;" />
                                            <cc1:ModalPopupExtender CancelControlID="btnClose" ID="mdlPopup" runat="server" TargetControlID="btnShowPopup"
                                                PopupControlID="pnlPopup">
                                            </cc1:ModalPopupExtender>
                                            <asp:GridView ID="grdReq" runat="server" AutoGenerateColumns="False" BackColor="White"
                                                BorderColor="#999999" BorderStyle="None" BorderWidth="1px" CellPadding="3" Font-Size="Small"
                                                GridLines="Vertical" HorizontalAlign="Center" Width="100%" Visible="false" AllowPaging="true"
                                                PageSize="10" OnRowCommand="grdReq_RowCommand" >
                                                <FooterStyle BackColor="#CCCCCC" ForeColor="Black" />
                                                <RowStyle BackColor="#EEEEEE" ForeColor="Black" />
                                                <Columns>
                                                <asp:TemplateField HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Center">
                                                        <HeaderTemplate>
                                                            Select
                                                        </HeaderTemplate>
                                                        <ItemTemplate>
                                                            <asp:RadioButton ID="rdoButton" runat="server" OnSelectedIndexChanged="rdoButton_CheckedChanged"
                                                                AutoPostBack="True"></asp:RadioButton>
                                                        </ItemTemplate>
                                                        <HeaderStyle HorizontalAlign="Left"></HeaderStyle>
                                                        <ItemStyle HorizontalAlign="Center"></ItemStyle>
                                                    </asp:TemplateField>
                                                   <asp:TemplateField HeaderText="ID" Visible="true">
                                                <ItemTemplate>
                                                    <asp:Label ID="lblId" runat="server" Text='<%# Eval("RequisitionID") %>'></asp:Label>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                                </Columns>
                                            </asp:GridView>

                                        </ContentTemplate><pre lang="HTML">

</asp:UpdatePanel>

HTML
<div class="footerpop">
                                  <input class="button_popup" id="btnClose" type="submit" value="Cancel" />
                              </div>
                              </div>
                              </asp:Panel>



aspx.cs

C#
this.grdReq.RowCommand += new GridViewCommandEventHandler(grdReq_RowCommand);
void grdReq_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            RadioButton rdb = FindControl("rdoButton") as RadioButton;
            foreach (GridViewRow row in grdReq.Rows)
            {
                if (rdb.Checked == true)
                {
                    ddlRequisitionID.Text = row.Cells[1].ToString();
                }
            }

        }

this grdReq.RowCommand += new GridViewCommandEventHandler(grdReq_RowCommand) can not fire .but why. pls help me
Posted

1 solution

As you're just changing selections in your 'event', you'd do better to write jquery to do it on the client without a postback. In general, you'd do well to stop laying competing MS libraries on top of each other, and use jquery.
 
Share this answer
 

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



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