Click here to Skip to main content
15,791,739 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
i created one modal box in my that modal box i put gridview control in that gridview control i put checkbox.

when pop up the modal box it's showing gridview data when the checkcox event "checkedchainged" event fires the modal box goes to invisible mode.but i need it's will be visible.

Iam using this code

<div class="modal hide fade" id="example">
  <div class="modal-header">
    <button type="button" id="b2" class="close" data-dismiss="modal" aria-hidden="true" runat="server">&times;</button>

    <h3>Data Export</h3>
  <div class="modal-body">
    <asp:GridView ID="gridlob" runat="server" AutoGenerateColumns="False"
        DataSourceID="SqlDataSource2" width="50%"
          onrowdatabound="gridlob_RowDataBound" >
            <asp:BoundField DataField="LOUPe_LOB" HeaderText="Line Of Bussiness"
                SortExpression="LOUPe_LOB" />
           <%--<asp:BoundField DataField="GroupFlag" HeaderText="GroupFlag"  ItemStyle-Width="2%"
                SortExpression="GroupFlag" />--%>
               <asp:TemplateField HeaderText="Grouping">

    <asp:CheckBox ID="chkReimbursable" runat="server"
       Checked='<%# GetStatus(Eval("GroupFlag")) %>'/>
                <asp:CheckBox ID="chkReimbursable" runat="server" OnCheckedChanged="chkReimbursable_CheckedChanged" AutoPostBack="true"  />

               <%-- <ItemTemplate>
                <%# (Boolean.Parse(Eval("GroupFlag").ToString())) ? "Y" : "No"%>


    <EditRowStyle BackColor="#2461BF" />
        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#EFF3FB" />
        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
        <SortedAscendingCellStyle BackColor="#F5F7FB" />
        <SortedAscendingHeaderStyle BackColor="#6D95E1" />
        <SortedDescendingCellStyle BackColor="#E9EBEF" />
        <SortedDescendingHeaderStyle BackColor="#4870BE" />

    <asp:SqlDataSource ID="SqlDataSource2" runat="server"
        ConnectionString="<%$ ConnectionStrings:LOUPe_InventoryConnectionString %>"
        SelectCommand="procExcelLOBGroupList" SelectCommandType="StoredProcedure">

  <div class="modal-footer">
  <a href="#" class="btn btn-primary" data-dismiss="modal">Close</a>


based on bootstrap js function the modal box is working

Please share any information to my issue
Updated 11-Sep-13 23:02pm

1 solution

Checkbox's AutoPostBack=True property causing the full postback of the page wihcih sets modal pop box's visiblity to default that is hidden. You can call
to display the popup.
Or you can put your GridView control in UpdatePanel to avoid full page postback which will retain the pop up box.
Share this answer
krish2013 12-Sep-13 8:27am    
Hii Suresh,
Where i have to write this function.
Suresh Suthar 12-Sep-13 8:31am    
You can use Page.RegisterClientScriptBlock method in chkReimbursable_CheckedChanged event handler after your code.
More info:
Member 10663198 23-Apr-14 5:43am    
i have problem in bootstrap 3.0 ..
its does not open the modal in any where...pls help me..

thanks in advance

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