locked
Modalpopup inside tabcontainer RRS feed

  • Question

  • User2001432087 posted

    Hi,

       I want to show a modal-popup inside TabContainer in asp.net c#. But I am not able to place inside tabcontainer. If you have same code please provide me.

    Wednesday, August 3, 2016 9:55 AM

Answers

  • User61956409 posted

    Hi ykkumar13,

     I want to show a modal-popup inside TabContainer in asp.net c#.

    If you’d like to show modal popup from tab panel, you could refer to the following sample code.

    <div>
        <asp:TabContainer ID="Tabs" runat="server" ActiveTabIndex="0" Height="128px"
            Width="332px" OnDemand="true">
            <asp:TabPanel runat="server" HeaderText="TabPanel1" ID="TabPanel1" OnDemandMode="Once">
                <ContentTemplate>
                    I'm tab 1, I was rendered at
                       
                    <%= DateTime.Now.ToString("T") %>
                    <br />
                    My OnDemandMode is &#39;Once&#39;
                </ContentTemplate>
            </asp:TabPanel>
            <asp:TabPanel ID="TabPanel2" runat="server" HeaderText="TabPanel2" OnDemandMode="Always">
                <ContentTemplate>
                    I'm tab 2, I was rendered at
                       
                    <%= DateTime.Now.ToString("T") %>
                    <br />
                    My OnDemandMode is &#39;Always&#39;
                  
                    <br />
                    <asp:Button ID="btnopen" runat="server" Text="Show Moadl" OnClick="btnopen_Click" />
                </ContentTemplate>
            </asp:TabPanel>
            <asp:TabPanel ID="TabPanel3" runat="server" HeaderText="TabPanel3" OnDemandMode="None">
                <ContentTemplate>
                    I'm tab 3, I was rendered at
                       
                    <%= DateTime.Now.ToString("T") %>
                    <br />
                    My OnDemandMode is &#39;None&#39;
                   
                </ContentTemplate>
            </asp:TabPanel>
        </asp:TabContainer>
    
        <br />
        <asp:Button ID="btperpro" runat="server" Text="Button" Style="display: none;" />
        <asp:Panel ID="pnlpropop" runat="server" Style="display: none;">
            I'm Modal popup 
            <br />
            <asp:Button ID="btnbclose" runat="server" Text="Close" />
        </asp:Panel>
        <asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server" PopupControlID="pnlpropop" TargetControlID="btperpro"
            BackgroundCssClass="mbg" CancelControlID="btnbclose">
        </asp:ModalPopupExtender>
    </div>
    

    Best Regards,

    Fei Han

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, August 12, 2016 10:02 AM

All replies

  • User-1404113929 posted

    hi,

    go through the bellow link.

    https://bytes.com/topic/asp-net/answers/814317-ajax-tabcontainer-modalpopupextender

    thanks,

    Murali

    Wednesday, August 3, 2016 9:58 AM
  • User2001432087 posted

    The link was not helpfull to me I already checked the link thanks.

    Wednesday, August 3, 2016 10:10 AM
  • User-1034726716 posted

    The link was not helpfull to me I already checked the link thanks.

    So you expect us to help you without giving us more details? What have you tried? What's not working? Are you getting any error? Where's the code that you've tried?

    Wednesday, August 3, 2016 11:01 AM
  • User61956409 posted

    Hi ykkumar13,

     I want to show a modal-popup inside TabContainer in asp.net c#.

    If you’d like to show modal popup from tab panel, you could refer to the following sample code.

    <div>
        <asp:TabContainer ID="Tabs" runat="server" ActiveTabIndex="0" Height="128px"
            Width="332px" OnDemand="true">
            <asp:TabPanel runat="server" HeaderText="TabPanel1" ID="TabPanel1" OnDemandMode="Once">
                <ContentTemplate>
                    I'm tab 1, I was rendered at
                       
                    <%= DateTime.Now.ToString("T") %>
                    <br />
                    My OnDemandMode is &#39;Once&#39;
                </ContentTemplate>
            </asp:TabPanel>
            <asp:TabPanel ID="TabPanel2" runat="server" HeaderText="TabPanel2" OnDemandMode="Always">
                <ContentTemplate>
                    I'm tab 2, I was rendered at
                       
                    <%= DateTime.Now.ToString("T") %>
                    <br />
                    My OnDemandMode is &#39;Always&#39;
                  
                    <br />
                    <asp:Button ID="btnopen" runat="server" Text="Show Moadl" OnClick="btnopen_Click" />
                </ContentTemplate>
            </asp:TabPanel>
            <asp:TabPanel ID="TabPanel3" runat="server" HeaderText="TabPanel3" OnDemandMode="None">
                <ContentTemplate>
                    I'm tab 3, I was rendered at
                       
                    <%= DateTime.Now.ToString("T") %>
                    <br />
                    My OnDemandMode is &#39;None&#39;
                   
                </ContentTemplate>
            </asp:TabPanel>
        </asp:TabContainer>
    
        <br />
        <asp:Button ID="btperpro" runat="server" Text="Button" Style="display: none;" />
        <asp:Panel ID="pnlpropop" runat="server" Style="display: none;">
            I'm Modal popup 
            <br />
            <asp:Button ID="btnbclose" runat="server" Text="Close" />
        </asp:Panel>
        <asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server" PopupControlID="pnlpropop" TargetControlID="btperpro"
            BackgroundCssClass="mbg" CancelControlID="btnbclose">
        </asp:ModalPopupExtender>
    </div>
    

    Best Regards,

    Fei Han

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, August 12, 2016 10:02 AM