bri189a Posted March 28, 2004 Posted March 28, 2004 Or anyone else... PlausiblyDamp let me know the wonders of the datalist control... much better than making dynamic tables... what I have is basically a page that is similiar to these... display items, and has buttons to edit or delete. The problem I'm having is that the edit and delete are only for administrators. How do I, via databinding, determine on a data list that because this guy isn't an administrator the buttons should not be visible... or I guess even loaded in this case? I'm learning a lot all at once and overwhelming myself... MSDE, ASP.NET, DataList control... if web form buttons have a visible property... could someone still back door it through 'View Source'... or does ASP.NET see that it isn't visible and doesn't even bother outputting it to HTML? Hope you follow... Thanks for the help... Brian Quote
kahlua001 Posted March 28, 2004 Posted March 28, 2004 You could so something like.. If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem Then If Not blnAdministrator Then CType(e.Item.FindControl("btnDelete"), LinkButton).Visible = False End If End If Quote
Administrators PlausiblyDamp Posted March 28, 2004 Administrators Posted March 28, 2004 Just a quick answer for now - you may want to investigate authentication within the .Net frame work. This will allow you to check if a user is in a particular role (group). The two main forms are Windows Authentication (useful if you have a windows domain) or Forms Authentication (if you need to create your own security model). If you have a search on MSDN or http://www.gotdotnet.com you should find a fair few examples. As to enabling or disabling these you may want to look at some of the events of the datalist - not sure which would be the most useful as my MSDN is playing up (doing a new install of VS at the moment). Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.