C# - Return Different SiteMapNodes For Different Roles?
May 22, 2010
I'm using my own SiteMapProvider which is just inherited and little bit rewritten System.Web.XmlSiteMapProvider.
I want to return different siteMapNode for clients and for managers. Or maybe the same but with different Title property.
View 1 Replies
Similar Messages:
Mar 7, 2011
I've created an asp.net sitemap with nodes that I will have to make visible on the condition of the sql table the webpage of the node accesses.
Where is the code of my sitemap.
[Code]....
Here is the code I have tried.
[Code]....
Each time I run this code the item.target, item.value, item.text equals the sitemapnode title. Yet, it should be different than this. I was hoping to store the table title of the sitemapnode in the value property. The reason for this is to enable my boss to modify the sitemap without having to explore the C# code. I'm lucky that if I could get him to open the sitemapfile. He does not want to worry about the code breaking down when he makes an addition to the sitemap node.
I have found that I can change the value programmatically in C# but this would contrast with what my boss would want.
View 3 Replies
Feb 24, 2011
Let's say I have a rolegroup as follows:
<asp:LoginView ID="lvDoSomeStuff" runat="server">
<RoleGroups>
<asp:RoleGroup Roles="RoleOne,RoleTwo">
<ContentTemplate>
...
</ContentTemplate>
</asp:RoleGroup>
</RoleGroups>
</asp:LoginView>
Is there a way I can make it so that a user must meet RoleOne and RoleTwo to satisfy the RoleGroup? By default, if a user is in either of the two roles, they will be granted access. I know I can do this via the code-behind, but I'd prefer to be able to wrap some content template with this markup instead of having to wrap it in a panel and hide the panel programmatically.
View 1 Replies
Sep 21, 2010
i want to implement asp.net role provider to assign users over my LAN to roles and have my asp.net intranet app implement security based on roles.
i dont want to use VS to manage this with the built in tools but rather hand this off to users to manage themselves. i want an admin folder with a page(s) for admin roles to be able to create/edit roles and manage users in roles... this way an admin can add a domain user (MyDomainUsername) to a role such as ProojectManager or Tester or Developer... and users wont need to contact me for these tasks...
can anyone provide me a link (or some sample code) to some sample i can use to admin roles and users over a LAN in asp.net with c#?
View 1 Replies
Mar 7, 2011
I have a multi level application that I am developing and need to block multiple rows from being joined. I know how to hide one role but I cannot figure out how to hide multiple.
Here is my current code
[Code]....
View 2 Replies
May 17, 2010
Newb question: what is the standard practice for assigning roles to newly signed-on members. Is it usually manual or is there a way of automatically assigning roles. Being completely new to this, I am confronted by the issue of my site having three different roles that new members could fall into, but am unsure about how to assign each a role. I can't imagine having to go through the process manually if I have thousands of members.
View 6 Replies
Aug 13, 2010
I have run into a problem where I need to remove certain items from collections that seem to only have get all functions.
My Idea is to get the full collection and then remove the unneeded items. Then take that new collection and bind it to whatever I need.
For example How do I get all the roles except administrator?
Roles strRoles = Roles.GetAllRoles()
RoleList.DataSource = (Roles) roles; //Roles.GetAllRoles();
RoleList.DataBind();
or How do I get all users but say user123
MembershipUserCollection users = Membership.GetAllUsers();
UserList.DataSource = users;
UserList.DataBind();
View 1 Replies
Nov 8, 2010
I have an update function in my data layer which is defined as:
public int UpdateRBTable(parameters ...) This calls a SQL Server Stored Procedure to perform an update function on the database.
The process does its job for updating the table. However, the stored procedure has a return value (which indicates how many rows were updated), but this return value is not returned to the application. The application always shows that a zero was returned from the stored procedure.
View 3 Replies
Jan 22, 2010
Can my WebMethod return an XmlDocument as return type?
When I try to consume the web service I'm still not getting XML. It appears as though a reference to the method is being returned rather than say a string containing XML.
<WebMethod()> _
Public Function CustomerSearch(ByVal lastName As String, ByVal firstName As String, ByVal companyName As String, ByVal city As String, ByVal state As String, ByVal email As String) As XmlDocument
' Create XML doc
Dim doc As XmlDocument = New XmlDocument()
' some more code
Return doc
End Function
View 4 Replies
Sep 28, 2010
how can i return 401 error from a method return ActionResult?
View 1 Replies
Dec 2, 2010
How can I assign a value to the methods return var BEFORE I return the final value?
Example:
public string Example()
{
[here I want to assign a value to the return var and continue this block until the end] = "TempStr"; [code].....
View 2 Replies
Jun 8, 2010
How to get asp.net return drop down list to return value as int
I want to pass the value to a stored procedure as an integer. But the default appears to be as a string which is not what the store procedure is expecting.
Is there a good way to return the list values as ints?
I suspect I can you set the value on the change selection event, is there another way?
View 2 Replies
Mar 26, 2016
I have an approve button.on clicking on this button it should show that an inactive value is present .Onclicking yes conformation it should save the data or else clicking on no conformation should return false; how i will do that?After alert it always submit the data.Â
protected void ibtApprove_Click(object sender, ImageClickEventArgs e)
{
string otherAffiliateName = txtRequestedAffiliate.Text;
int inActiveAffiliates = new BLRating().InActiveAAffiliateChecking(otherAffiliateName);
if (inActiveAffiliates > 0)
[code]...
This is the code i used.how i wiil stay back on Confirm 'no' click?
View 1 Replies
Feb 7, 2011
I am writing my first MVC 3 aplication (in ASP.NET) and I don't know how I can(should) display the menu for different users.
My app is created as MVC3 Web Application and the menu look like this:
[Code]....
Now, I want to show another links for user(Projects, Profile) and for admin(Manage Projects, Manage Accounts, Manage news). How I should do that?
View 5 Replies
Jan 31, 2011
I am building a content management system and so far I am trying to get a member's area to work. I figured out the CreateUserWizard and the Login controls. I also used Roles.AddUserToRole(RegisterUser.UserName, "Member"); upon account creation to assign the user the role of a "Member". I have been googling but I havent been able to find a solid way on how to restrict either a directory or a page to make it so that only "Member" users can access it, otherwise redirect to login page. Can anyone give me an idea for this? Also I had a related question, when I go on to the site and I am NOT logged in, what is my default role? is it guest or just null?
View 2 Replies
May 23, 2010
I need to get know how SiteMapProvider.IsAccessibleToUser() works. Built-in XmlSiteMapProvider calls HttpContext.User.IsInRole() which uses System.Security.Principal.GenericPrincipal in case of forms authentication.
Where does the current user gets its roles? Which provider loads this kind of information? I want to overload it and use custom logic.
View 2 Replies
Nov 30, 2010
I want to be able to specify which roles having access to certain controllers in web.config and use it something like this:
[Code]....
..but the compiler says "Error 1 An attribute argument must be a constant expression, typeof expression or array creation expression of an attribute parameter type...". How to accomplish this behavior?
View 3 Replies
Apr 3, 2010
I'm developing a web application I want to use the role authentication to control different parts of the website accessibility. But my problem is say I implemented a upload and download functionality on one of the page and I want to have the ability to control a user whether they can either upload or download; or both. So, I'm not exactly sure if the role base authentication can support a user with more than one role to work the way I want it.
View 1 Replies
Sep 24, 2010
I have a pdf file that will be stored in a website and based from roles it will call the certain pdf files. (done with this save pdf inside a folder then call it using sitemap per pdf files according to roles) but I need a search page that will search a given pdf file name based on their roles, they can only see the pdf that is intended for them then via link it will then see all the pdf that was search.
View 1 Replies
Feb 25, 2011
There is a way to get the array of role from the HttpContextBase ?
I'm looking to do a class like that:
public static IList<string> GetUserRoles(this HttpContextBase context)
{
if (context != null)
{
}
// return roles array;
}
View 2 Replies
Aug 11, 2010
I am baffled, I am using a treeview to set the source of an iframe. The web page is being displayed correctly, but User.IsInRole("roleName"), in the code behind, always returns false. The strange thing is User.Identity.Name returns the correct user name. I have tried setting the target of the tree view nodes to "_blank" and to "_self" and still no luck. So, it doesn't appear that the problem is related to the iframe.Before the treeview was added, javascript was used to set the source for the iframe and User.IsInRole returned the correct values.
View 4 Replies
Aug 23, 2010
I am new to MVC and am using MVCContrib and trying to use the Checkboxlist .My requirement is to display list of all available roles on create user page . I have dine as below .
<%=this.CheckBoxList("Roles").Label("Roles:").Options(new MultiSelectList(Roles.GetAllRoles(),"DataTextField","DataValueField"))%>
In this case GetAllRoles method retuns string[] . How can I assign the "DataTextField","DataValueField" to make it work ?
View 7 Replies
Jan 7, 2010
I have used .net login control to authenticate user,i have three types of role ,role1,role2 and role3 and i have users and user have different roles.
now my requirement is like as per loggedin user i want to redirect user on particular page as per role.
for example if loggedin user role is role1 than he will redirect default1.aspx
for example if loggedin user role is role2 than he will redirect default2.aspx
for example if loggedin user role is role3 than he will redirect default3.aspx
and one question if same user may be have more than one role than what should happen???
I got a solution for same than if we are used "loggingin" event than it would be possible but i had placed login control in login view anonymous template because as per my requirement i want that after successfull login user can't see login control on page.thats why i didn't get the login control event on code.
View 6 Replies
Jan 18, 2010
My project has a Guest folder and an admin folder.
Guest has a guest1.aspx page and admin has admin1.aspx page.
Now I am trying to figure out a login control which will check the role of the user and send them to the respective pages accordingly.
The names are not in the database or the active directory...
These names are on the windows 2003 server...
So I need to check from the server if the user exists and what is its role in it.. Suppose there is company which has 10 employees and one administrator.. the company has a server and these employees are on the same domain. So the admin can add that machine to the server or delete it.. now every machine has its username password and domain.. i want my gui to use the same credentials to log into the gui and send them to the respective pages according to the role..
View 2 Replies
Mar 22, 2010
In our system now, we have a class of user and beneath each class, there's a type of user.
Is there a way to setup and use the ASP.Net role provider with this kind of setup?
View 2 Replies