Question: Could anybody help me out to get nested tabs through ajax calls.

Description:
I am having Jquery Tabs with ajax option

CODE:

```
$( ".has_ajax_tabs" ).tabs({
        ajaxOptions: {
            error: function( xhr, status, index, anchor ) {
                $( anchor.hash ).html("<h3>OOPS...Something went wrong!</h3> Couldn't load this tab at this time. Please try again later.");
            }
        },
        spinner: "Loading...",
        fxSlide: true
    });

```

HTML CODE:

```
 <div id="tabs" class="has_ajax_tabs">
                                 <ul>
                                     <li><a href="#tabs-1">Profile Details</a></li>
                                     <li><a href="nestedTabsLink.php">Users</a></li>
                                 </ul>

 <div id="tabs-1">  Profile Details form here </div> </div>

```

nestedTabsLink.php loaded by Ajax call

```
<div id="tabs-nested" class="has_ajax_tabs">
    <ul>
        <li><a href="#tabs-inner1">Inner Tab1</a></li>
        <li><a href="#tabs-inner2">Inner Tab2</a></li>
    </ul>
    <div id="tabs-inner1">
        Nested Tabs1
    </div>
    <div id="tabs-inner2">
        Nested Tabs2
    </div>
</div>

```

ERROR: The loaded nestedTabsLink.php file also having tabs which is not working if loaded by Ajax. Without Ajax it works perfect. Can anybody help me to get the code snippet/guidelines?

Thanks

Answer: 
That's a bad idea. The lifetime of a threadpool thread is determined by the code it executes, preferably short and snappy. This is *not* the rule for an STA thread, it must stay active and pump a message loop as long as the COM objects that were created on that thread are not finalized. A requirement that's very incompatible with a TP thread. Trying to do this anyway will just buy you never-ending misery with "COM object that has been separated from its underlying RCW cannot be used" exceptions as well as deadlock. This is why a .NET tp thread is always MTA.

You must use a regular Thread.
I have analyzed the source code and found out that SmartThreadPool doesn't support STA threads. The only way to create them is to modify the sources as follows:

1. Add *StartSTAThreads* property to the *STPStartInfo* class.
2. Add 

```
if (_stpStartInfo.StartSTAThreads) 
{
    workerThread.SetApartmentState(ApartmentState.STA);
}

```

to the *SmartThreadPool.StartThreads* method before *workerThread.Start()* call.