Click here to Skip to main content
11,437,002 members (65,689 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET
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

<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>

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


aspx.cs

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-Jan-13 0:56am

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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.
  Permalink  

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



Advertise | Privacy | Mobile
Web04 | 2.8.150428.2 | Last Updated 1 Jan 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100