Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
i created one modal box in my page.in 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


XML
<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>
  <div class="modal-body">
    <asp:GridView ID="gridlob" runat="server" AutoGenerateColumns="False"
        DataSourceID="SqlDataSource2" width="50%"
          onrowdatabound="gridlob_RowDataBound" >
        <Columns>
            <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">

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

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

        </Columns>

    <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:GridView>
    <asp:SqlDataSource ID="SqlDataSource2" runat="server"
        ConnectionString="<%$ ConnectionStrings:LOUPe_InventoryConnectionString %>"
        SelectCommand="procExcelLOBGroupList" SelectCommandType="StoredProcedure">
    </asp:SqlDataSource>

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

  </div>
</div>



based on bootstrap js function the modal box is working


Please share any information to my issue
Posted
Updated 11-Sep-13 22:02pm
v3

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
$('#example').modal('show')
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
 
Comments
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:
http://msdn.microsoft.com/en-us/library/system.web.ui.page.registerclientscriptblock.aspx
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