Click here to Skip to main content
15,901,205 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to hide some menu on master page load after user Login, but my case after user Login Master Page load first time menu are hidden to user.but Master page again load that time hidden menu show to user but i don't want to show this menu to user. so how can hide this menu from user.provide solutions.

My code is:

HTML
 static int Permission = 0;
 if (!Page.IsPostBack)
  {
    if (Permission == 0)
    {
       ChkPermissions(); Permission = 1; 
    }
  }

public void ChkPermissions()
        {                          
          
            Ld = (LoginUserDetails)Session["userdetails"];
            if (Ld.Agent_Id > 0)
            {
                Linkdisable();
                foreach (var item in Ld.LoginPermissions)
                {
                    if (item.PermissionOperationName == "Access")
                    {
                        switch (item.PermissionItemName)
                        {
                            case "LandLord Master":
                                {
                                 
                                    LandlordPage.Visible = true;
                                    break;
                                }
                            case "Property Master":
                                {
                                   
                                    PropertyPage.Visible = true;
                                    break;
                                }
                            case "Parcel Master":
                                {
                                   
                                    ParcelPage.Visible = true;
                                    break;
                                }
                            case "Unit Master":
                                {
                                  
                                    UnitPage.Visible = true;
                                    break;
                                }
                            case "Tenent Master":
                                {
                                   
                                    TenentPage.Visible = true;
                                    break;
                                }
                        }
                    }
                }
            }
        }

public void Linkdisable()
        {
            AssignRolesPage.Visible = false; 
            LandlordPage.Visible = false;
            TenentPage.Visible = false;
            PropertyPage.Visible = false;
            ParcelPage.Visible = false;
            UnitPage.Visible = false;
          
        }
Posted
Comments
JoCodes 14-Feb-14 3:51am    
What are those controls that you try to hide in Linkdisable()?
rahul003 14-Feb-14 4:45am    
its a hyperlink controls
JoCodes 14-Feb-14 5:00am    
"Master page again load" in your question means PostBack right?
rahul003 14-Feb-14 5:08am    
yes PostBack
JoCodes 14-Feb-14 5:12am    
Just tried to simulate the same but seems to be working for me.Have debugged and checked the Linkdisable() method is not getting called on Postback conditions?

1 solution

 
Share this answer
 
Comments
rahul003 4-Mar-14 4:03am    
not yet.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900