Hi there, We have a menu system built using the treeview control. All items of the menu are stored in an XML file and populate at runtime. I need to implement a new feature to this treeview control and its causing me to pull my hair out (not that I have much to pull out) I need to implement a user rights feature, where each page of the menu can be assigned to a user, if the user has that page, they see the menu structure etc. For example, if I have the following structure: Menu -Sub heading 1 --page 1 --page 2 --sub heading 2 ---page 3 ---page 4 -sub heading 3 --sub heading 4 ---page 5 User 1 has the rights to page1, page 3 and page 5 so his menu would be -sub heading 1 --page1 --sub heading 2 ---page 3 -sub heading 3 --sub heading 4 ---page 5 User 2 only has access to page3 and page 5 so their menu should be -sub heading 1 --sub heading 3 ---page 3 -sub heading 3 --sub heading 4 ---page 5 Getting the page access and finding user credentials isn’t an issue, but I’m really struggling to figure out some logic to generate the menu, keep the subheadings there if they are needed and not show anything that is blank. Has anyone done anything like this in the past? Any tips would be great, and code would be fantastic – but I’m really only looking for ideas on how to complete this. I’m sure I’m making it harder than it needs to, and I’m also sure loads of people have done this without a problem Thanks in advance
S
stevehammond
@stevehammond
Posts
-
treeview at runtime with user rights -
2 simple questionsTo get the IP use something like
public string getClientIPaddress() { string IPAddress = HttpContext.Current.Request.ServerVariables\["HTTP\_X\_FORWARDED\_FOR"\]; if (IPAddress == null) { IPAddress = HttpContext.Current.Request.ServerVariables\["REMOTE\_ADDR"\]; } return IPAddress; }
As for the host i'm not really the best to answer that, we have our own servers in a datacentre, I know there are good sites out there to show and compare them