tags:

views:

14

answers:

1

Hello All i am doing project in ASP .Net MVC 1.0.I want to display tabpanel based upon permission.i.e. i have written function which will return boolean value and based upon that value i want to display tab panel on my view page.My database contains velue for UserBrowseTab only

              <%if(Utilities.checkPermissions(1, "UserBrowseTab", "UserManagement") == 
                     true)
                  { %>
               <asp:TabPanel runat="server" HeaderText="Browse" ID="tabBrowse" Enabled="true">
                    <ContentTemplate>
                </ContentTemplate>
            </asp:TabPanel>
            <%}if(Utilities.checkPermissions(1, "UserGeneralInfoTab", "UserManagement") == true)
                  { %>
             <asp:TabPanel runat="server" HeaderText="GeneralInfo" ID="tabGeneralInfo" Enabled="true">
            </asp:TabPanel>
            <%}%>

but here both condition's get satisfy and both tabs are displayed on view page

+1  A: 

maybe you should use else if if you don't want to satisfy both condition.

I need answers
I have used else if in code but still both tabs are displaying in tab panel..please provide another solution
Yanka