0

Hi,
I have one navigationmenu on my masterpage. Whenever a user logins, the navigationmenu should display the menuitems as per the users permission.

eg: i have three navigationmenu items i.e. menuitem1, menuitem2, menuitem3.
a normal user has access only to two menuitems i.e. menuitem1 and menuitem2. And the third menuitems is either disable or hidden to him.

So when a user logins, he can only see two menuitems i.e. menuitem1 and menuitem2.
My Program: wht I did is I wrote user authentication code on my login.aspx page
i.e.


If lbl.Text = "user" Then
nwperm()
Response.Redirect("Home.aspx")
end if

HERE nwperm is a function which i wrote in the class file located in App_Code folder.


Sub nwperm()

Dim mymenu As Menu = Master.FindControl("NavigationMenu")

Dim mymi As MenuItem = mymenu.FindItem("TechnicalSupport")

mymi.Enabled =True

end sub

Problem/error: object reference cannot create an instance of an object.
Plz help me...

2
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by mirzamujib
0

On which line of code do you get the error?

code written in my class file.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.