Web Forms :: Disable Some Menuitems Depending On Role?
Apr 12, 2010i am using a menu in masterpage.Based on user login i want to disable some menuitems depending on role.how to do this?
View 7 Repliesi am using a menu in masterpage.Based on user login i want to disable some menuitems depending on role.how to do this?
View 7 RepliesI am working with the master pages which contain the Manu control. I want to disable the few menuItems from the master page's Menu control in the child form. I have tried so many times but I only succeded to disable the whole menu of master page, but my sanerio is different. I have to disable only few MenuItems from Menu and also want to disable few Items of Submenu
View 2 Replieshow to disable MenuItems for selected users.
I am using Telerik RadMenu. I have different users, now i want to block some users access. I want to disable the MenuItems whenever user login to his account.
I will give you much more data if needed. I want to know from where should i start at first.
I have a Menu control in MasterPage based on web.sitemap file. My website has roles enabled (AspNetWindowsTokenRoleProvider) and uses Windows authentication mode. So, user has to be in a specific Windows Group to be able to access the site. I need to allow some users to see all menu nodes and some restricted set of nodes. How do I do that?
I would like to be able to create, say following Windows groups:
domain_namemy_app_users
domain_namemy_app_superusers
domain_namemy_app_admins
and code sitemap nodes this way:
<siteMapNode url="~/MOC_Masterdata_MOC_Approvers_Plain.aspx" title="MOC Approvers" description="MOC Approvers" />
I have been looking on the internet but don't seem to be able to find the answer. I am wondering is there a way to disable a validator on both the client and server side depending on the value of another control.
The situation is that I have a radiobutton that hides a textbox depending on the radionbuttonlist selected value . So I want to disable a validator on both server and clientside if the value selected is "N".
I have a simple custom membership provider. And i have a roles table also in my database with 2 roles in, User and admin. I dont think i need to implement the roleprovider as this will be overkill for what i need.
How can i modify the validate user method to route users to one URL and admin to another?
Can i put in a If statement to say If role = admin go here after a user has been validated?
[Code]....
I have a page that I need to disable, or re-direct to another page if a different type of user logs in.
The application has this page for one type of user but another type of user is not allowed access it.
How would you do this type of thing?
my asp.net application is workflow enabled.
by default all nodes of the tree should be disabled
once the workflow is completed.i need to enable the link of treeview??
my basic question is how to enable or disable the nodes the treeview depending on condition
suppose
if var a=0
then
LinksTreeView.SelectedNode.SelectAction = TreeNodeSelectAction.None;
I don't know how to do this, I think I need to find the control first.
[Code]....
I want to enable or disable text box in specific row depending on value of field in data source
View 5 RepliesIs it possible to programmatically disable/enable say column field drill through capability of the matrix table report depending on the textbox.text of dropdownlist value but retaining drill through capability of row fields ?
View 1 RepliesI have four Imagebuttons that I want to disable depending on the Role the user belongs too. I know how do do this in a gridview or detailsview but for some reason it isn't working on just a plain form. So when a User who is not in the "Admin" role logs onto the page he either doesn't see the button or the hyperlink has been disabled thus not allowing him to proceed any further.
View 6 RepliesTrying to find in the internet and in this forum answer to my problem, I created a compositecontrol where a Menu control is created when this custom control (.dll) is loaded and generated at runtime, no problem, as menu control is generated ok, but having problem with spacing between MenuItems and Hover won't work. I am using XmlDataSource to supply data to the Menu Control (menu item data comes from a xml).
I am trying to set width of the rendered page elements, to control spacing it does not work, and also set a "hover" css class to mnuCtrl.StaticHoverStyle.CssClass and mnuCtrl.DynamicHoverStyle.CssClass and it doesnot work.
I'm trying to find out if or how it's possible to keep the MenuItems highlighted of a menu control as you navigate down the hierarchy.If I have deep menu, say 3 layers, I'd like to keep the path the user took highlighted.
View 4 RepliesI have a datalist menu that has several menuitems in it(each item load user control).I want to show each menuitems in seperate dynamic Ajax tabs when I click on first item tab is created but when I click on second menuitem to create second dynamicajax tab I faced this error:
[Code]....
[Code]....
I wondered if anyone knew how to utilize the asp:Menu control with <H2> around the Item Headers. If so, how were you able to implement it?
<asp:Menu ID="mnuMain" runat="server" ForeColor="White" StaticDisplayLevels="2" Font-Bold="False" ToolTip="Main Menu" SkipLinkText="" MaximumDynamicDisplayLevels="1">
<DynamicMenuStyle BorderStyle="Dotted" />
<DynamicMenuItemStyle ForeColor="Black" />
<Items>
[code]....
Usually in sub-folder we will limit the access right to some roles and this feature requires pre-defined database schema.
However, if i still want to use this role feature of asp.net, but I do not like the pre-define database schema, I want to extract role information from my own database table and bind it to the role.
Why asp.net sql role provider does not allow to update the role name , whats its reasons.
View 5 RepliesWhen adding a role (making use of asp.net's role provider), i cannot find a method to add a role including a description.the asp.net Role table in SQL makes provision for a role description, however the only method available is:Roles.CreateRole(string RoleName);here is no overload to include a description.Is there an out of the box way of including the description? or should i go about this myself?
View 1 RepliesI am in the process of creating a user control that enables content areas of our web application to be editable. The control utilizes the asp.net membership/role providers and incorporates a LoginView that only displays the edit link if a user has logged in and is a member of the desired role. What I would like to be able to do is pass the "role" as a property of the control so it can be set dynamically and does not have to be hard coded into the control if I use elsewhere in another application.
View 3 Repliesi have a div in aspx page that shows a google ad.
in database i have a field which has value 1 / 2.
if 1 i want to enable the div --> ie:showit visible.
if value=2 i want to hide that div. hide in the sense there should be no blank space aand usr should not notice that somthing is hidden.
How can i get the role id, rather than the role name?
For instance with the code below
Dim roles1 As String() = Roles.GetAllRoles()
GridView1.DataSource = roles1
GridView1.DataBind()
I can access the role name in the gridview like below, but how could I get the ID to pass in a hyperlink?
<asp:Label ID="lbl1" runat="server" Text='<%#Container.DataItem.ToString() %>' Visible="false" />
i have 3 dropdown list box 3rd dropdown populate depending on 2nd drop down and 2nd drop down populate depnding on 1st value of drop down in asp .NET C#
View 9 Repliesi have a database with a field for 'hasimage' with values true/false.
if it is true i want to display img1 and if false i want to display img2.
currently i have a single static image which takes user to the url.
code aspx:
<a runat="server" id="hlkmail">
<img src="../images/send_mail_icon.jpg" alt="" /></a>
<a>Send<br /> Mail</a>
code aspx.vb:
hlkmail.href="remail.aspx?clientname="&clientname
now, i want to use the db value and accordingly display img1 / img2, onclick of which will take the user to the url.
this is my aspx page code :
<a runat="server" id="hlkmail"><img src="../images/send_mail_icon.jpg" alt="" /></a>
<a runat="server" id="hlkgallery"><img src="../images/galleryl_icon.jpg" alt="" /></a>
this is code behind (aspx.vb) :
hlkmail.HRef = "sndmail.aspx?Clientname=" & clientName
hlkgallery.HRef = "pgallery.aspx?Clientname=" & clientName
above code shows fixed images.
i want to display image dynamiccally depending upon the db value.
i have a stored proc that returns hasmail ='true/false' and hasgallery='true/false' from database.
if true i want to display send_mail_icon.jpg else send_mail_icon_watermark.jpg
and gallery_icon else gallery_icon_watermark.jpg. i want to do this in code behind using if loop.