Skip to main content

Posts

Showing posts from March, 2015

Adminlte Tabs reset on DNN post back

Dear All,
I worked with Admin Lte tabs and i found when the form has submitted than the respective fist tab will be selected always.

As a result the user focus will be out.

here is a solution for it

Add the following code in ascx control file

<script type="text/javascript">
    $(function () {
        var tabName = $("[id*=TabName]").val() != "" ? $("[id*=TabName]").val() : "tab_1";
        $('#Tabs a[href="#' + tabName + '"]').tab('show');
        $("#Tabs a").click(function () {
            $("[id*=TabName]").val($(this).attr("href").replace("#", ""));
        });
    });
</script>
<asp:HiddenField ID="TabName" runat="server" />

Following code will be added on the code behind
TabName.Value = Request.Form[TabName.UniqueID];

I hope it resolve your issue as well

Regards
Rashid Imran Bilgrami