Is this usercontrol a for a datatype, dashboard, or is it to be displayed on the front-end?
If it's a Dashboard control, you should be able to restrict it in the /config/Dashboard.config file - check out the existing entries and the <access> node which you can use to deny certain roles.
If it's a datatype, you can't really restrict the datatype from "loading", but in your usercontrol code you can do something to make it invisible or render differently for different users by adding something like this in your Page_Load event:
if (!umbraco.BusinessLogic.User.GetCurrent().IsAdmin()) { // do something different for non-admins // hide a panel? pnlWhatever.Visisble = false; }
You could also check out something like the Axendo Disabled Properties package to disable certain properties by roles. Hope this helps...let us know the details if you need more assistance :)
Help with usercontrol in asp.net
Dear Forum ;)
First I am new to umbraco and just made a simple new site with my first working usercontrol.
I want to make a usercontrol in asp.net with a textstring and a button that can be viewed by administrators and not by users can this be done?
Good tutorials is needed too.... :)
Thanks and best regards
Jakob
Hi Jakob,
Is this usercontrol a for a datatype, dashboard, or is it to be displayed on the front-end?
If it's a Dashboard control, you should be able to restrict it in the /config/Dashboard.config file - check out the existing entries and the <access> node which you can use to deny certain roles.
If it's a datatype, you can't really restrict the datatype from "loading", but in your usercontrol code you can do something to make it invisible or render differently for different users by adding something like this in your Page_Load event:
You could also check out something like the Axendo Disabled Properties package to disable certain properties by roles. Hope this helps...let us know the details if you need more assistance :)
For general info on usercontrol datatypes: http://www.nibble.be/?p=24 http://www.nibble.be/?p=97 http://umbraco.com/help-and-support/video-tutorials/developing-with-umbraco/data-editors/creating-a-custom-datatype-using-the-usercontrol-wrapper/TVPlayer
-Tom
Hello Tom
Thank you for your reply it worked like a sharm :)
Thanks, Jakob
is working on a reply...