We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Tab and iFrame

Thread ID:

Created:

Updated:

Platform:

Replies:

131952 Aug 4,2017 10:56 AM Aug 7,2017 08:33 AM ASP.NET MVC 1
loading
Tags: Tab
LUCIANO ALMEIDA PIMENTA
Asked On August 4, 2017 10:56 AM

I have a tab and I need to create tabs dynamically. It works correctly, I pass a URL in the creation of each tab in the ASP.NET MVC project.

Is it correct or should I use an iframe to load it separately from each index in my project. If the best option is the iframe, how can I use it?

Prince Oliver [Syncfusion]
Replied On August 7, 2017 08:33 AM

Hi Luciano, 

Thank you for contacting Syncfusion support. 

Yes, it is correct to pass URL in the creation of each tab, this will render the content from the URL in the tab item. So there is no need to using an <iframe> inside tab control. You can also use AJAX to create and load the tab item dynamically. Kindly refer to the following code snippet. 

<div style="width: 500px"> 
    @{Html.EJ().Tab("URLTab").Items(data => 
        { 
            data.Add().ID("URLTabQuickList").Text("Quick List").Url("../Content/QuickListTabContent.html"); 
        }).Render();} 
</div> 
<input type="button" value="addItem" id="item"/> 
<script> 
    $(function () { 
        $("#item").on("click", function () { 
            $.ajax({ 
                url: '../Content/PartsTabContent.html', 
                datatype: "html", 
                success: function (data) { 
                    var tabObj = $("#URLTab").data("ejTab"); 
                    tabObj.addItem("#URLTabParts", "Parts", 1); 
                    $('#URLTabParts').html(data); 
                } 
 
            })  
        }); 
    }); 
        
</script> 


Regards, 
Prince 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;