knockout Js partial view binding problem RRS feed

  • Question

  • User1308732545 posted

    Hello All ,

    I have scenario like this :

    There is a page in which I have two tabs 1 & 2 .
    There are permissions to view these tabs Permissions A & B

    If the user has both the permissions they can see both the tabs , if the user has permission B then they can only view 2 as a page and not a as a tab

    The data-binding for tabs is done using knockout js
    This code looks like this:

        <div id="Tabs">
            @if (condition)// check to see if user has permission , then display 2 tabs 
                    <ul class="nav nav-tabs" role="tablist">
                        @foreach (var tab in Model.Tabs)
                            <li role="presentation">
                          <a href="#@tab.PartialName" data-toggle="tab" role="tab" data-bind="click:showpartial.bind($data,'@Url.Action(....)')">@tab.Name</a>
            else // display patial as a full page
                    Html.Partial(PartialName, Model))            
            <div role="tabpanel" id="tabView" class="tab-pane active">

    everything works fine if both the tabs are displayed , the problem arises when the tab is displayed as page

    it throws error "Unable to process bindings"

    Please help


    Thursday, November 10, 2016 12:17 PM

All replies

  • User-693045842 posted

    Seems you are not correct when applying knockout js :



    besides , have you call the tabs?

    <script type="text/javascript">
        $(function () {

    Friday, November 11, 2016 6:58 AM
  • User1308732545 posted

    Hi there , 

    Yeah I am returning the tabs from the controller method 


    Friday, November 11, 2016 9:25 AM
  • User-693045842 posted

    Hi ,

    sorry for the late , have you checked my link ? any update ?

    Tuesday, November 29, 2016 6:56 AM