show each user pages which can access, without using membership or roles

 

hi

i have the following scenario:
each employee authorized to just enter some pages in web site, as an example : jack can enter page 1 ,2 and 3 ,mary can enter page 1 and 3;
i want each employee to see a treeview that show him/her the pages that can enter;
what is the best way to implement this dynamic view, i mean, i want each employee when enter to see a treeview with pages that can access and i need to keep this tree view alife while he is logging on.
HINT: i am not using neither membership nor roles in my web site, i have my own database to store users and to store pages which they can access

is there any useful tutorial in this domain

thank you

0
hnj_judge
2/13/2009 1:01:24 AM
asp.net.navigation-controls 13714 articles. 0 followers. Follow

5 Replies
627 Views

Similar Articles

[PageSpeed] 6

First you need to configure the roles and corresponding pages. You can do this in an XML file or in database.

Simple XML file in this regard would be like

<roles>

<role name="employee">

<pages>

<page name='First.aspx' displayname='First' />

<page name='Second.aspx' displayname='Second' />

<page name='Third.aspx' displayname='Third' />

</pages>

</role>

<!-- Similarly for other roles as well -->

</roles>

0
hkatakam
2/13/2009 7:11:08 AM

You can use the built in features of the site map for this.

  1. Create your site map file with all of your pages in it.
  2. Modify web.config to add authorization rules (use the location element to specify individual files and which users/roles can access them).
  3. Modify web.config and add a site map configuration with security trimming.
  4. Use a SiteMapDataSource control and bind the TreeView to it. The site map data source control will read the site map, but only show nodes for which the user is authorised.

Read up on this at the QuickStarts: http://quickstarts.asp.net/QuickStartv20/aspnet/doc/navigation/default.aspx

0
Dave
2/13/2009 9:10:09 AM

 thank you for your reply

but actually i dont have any membership or roles implementation in my website, i have my own database to save users information, and in this database i have information about pages which they can access

how can i do this in this constraint 

thank you

0
hnj_judge
2/13/2009 8:38:33 PM

Create authorization tables in your own database and then create the treenodes based on that..


SHASHANK BHIDE
CAPGEMINI INDIA
"THE ROAD TO SUCCESS IS ALWAYS UNDER CONSTRUCTION MARK MY RESPONSE AS ANSWER TO HELP ME BUILD IT :)"
0
shashankgwl
2/14/2009 5:38:02 AM

In this case you'll want to build a list yourself, using your own authorisation rules to identify whether the user is allowed to see that page or not. For performance reasons you'll probably want to cache this data (use the Cache object) so that you don't read it from the database for every page.

0
Dave
2/14/2009 1:01:40 PM
Reply:

Similar Artilces:

Controlling user roles to access different page without using Web.Config
hi, i have an application where all my user roles is actually been define inside the database.Is there anyway i can do in asp.net rather then putting the user web control into every pages like in the classic asp? Using Role-Based Authorization With Forms Authentication. Check this post (mine:) and in the page_load use: If User.Identity.IsAuthenticated Then     If User.IsInRole("Role1") Then         ' Do something     Else        ' Do nothing     End If Else  ...

How can I access a control on a master page from a user control using properties?
Hi, I have a master page which I'm using on my aspx page.  Within this aspx page is a user control and I would like to set a label on my master page using a value from my user control. I can do this using FindControl as shown below but I would like to use properties in my master page. The following code in my user control works perfectly: Label theFormName = (Label)this.Page.Master.FindControl("lblFormName");theFormName.Text = "My Test Form"; However I've been told that using properties is a much better ideas (errors would be picked up at compile time an...

Can we access controls within user controls on the client side without using ctl0_ControlsName
When we create controls within our user controls, the way we can access those controls in client side is i guess:getElementByID('the client id')but the server chnages the names of those controls to:  clt0_Controlsname, so i always have to use add ctl0 when I want to access to my controls of the user control on the client side.is there a solution to this or that s just the way it isthank you Thanks a lot, I appreciate your taking the time to help me. Hello tutus,this is maybe the most frequent question in this forum, did you notice?This problems is related to all server co...

Can I use Security Triming for Menu Navigation without using Membership & Roles?
Hi, I have 2 questions:   Question #1: I would like to be able to hide a certain node of my left menu navigation depend on the user roles.  This can be easily done if I use the provided Membership & Roles from .NET 2.0.  However, I am not.  I keep all the user roles in an Oracle table.  Is there a way for me to use Security Triming without using Membership or Roles?  My left menu is built as a web.sitemap in XML FORMAT.   Question #2: I also have a 2nd applicatiion that use <div> for my static menu.  It worked very well and easy to mai...

Image on User control not showing on page using user control.
I have a user control under the folder ~/Common/Controls. The user control has a table. I want to set the table row background. The images for the background are being stored under ~/Common/Images. The page that used the user control is in ~/Front/FrmHome.aspx. Now, if I specify the background as background="../Images/bk.gif", the background shows in the user control but not on the page using the user cintrol as expected. If I specify the background as background="/MyWebProject/Common/Images/arrow1.jpg", it shows fine in the user control but doesn't show up agai...

Howto Show the user which roles has access to a certain page based on the roles assigned to that page in web.config?
Hi!I have started to build a website which will be using Formsauthentication through the ActiveDirectoryMembershipProvider. For Roles I´m using the AuthorizationStoreRoleProvider for Roleauthorization against Active Directory. If the user isn´t authorized to access a page because he/she does not belong to a certain role/roles specified in web.config, than the user is redirected to the login page. Now my question. Is it possible, at the login page, to programmticly check which role/roles the user had to be in to be able to see the page requested and show this roles for the user? So that ...

Can I access the controls on previous page without using PostBackUrl or Server.Tranfer?
Hi guys,I have a question about accessing the controls on previous page. I know it could be done by PostBackUrl or Server.Transfer, but my problem is I'm using Javascript to pop up and close down the second page. Normally, if we open the second page by PostBackUrl or Server.Transfer from the first one, any control could be accessed. But my second page is a popup window, using PostBackUrl or Server.Transfer will disable my Javascript popup function. So is there still a way to do it? Thanks!   this.Page.PreviousPage.FindControl("");Hope it helps.-Manas================...

values of web controls in user control can not be access from other pages???
I have aspx page(brief code: includes ascx file) <%@ Register Src="reseller.ascx" TagName="reseller" TagPrefix="uc1" %> <form id="form1" runat="server"> <uc1:reseller ID="idreseller" runat="server" /> </form> the code for asxc file . i have the PostBackUrl to reseller.aspx <asp:TextBox ID="txtPostCode" runat="server" CssClass="form1" Width="50" MaxLength="4" /> <asp:ImageButton ID="ibtn"  ImageUrl="images/searchbutton.jpg" PostBackUrl="~/reseller.aspx" runat="server"  /> In my reseller page i try to read the post value of control txt...

Accessing a control inside of a User Control within a master page using jscript
To be more precise, I'm using a master page called Main.Master, i have one web form called default.aspx.  It contains nothing. I use user controls to display everything.  For simplicity sake the user control here will be called newproject.ascx. This user control has several text boxes and a save button.  When the save button is clicked, I want to utilize the OnClientClick event and use javascript to validate the values in all the controls before passing them to sql. The source for the button is as follows: <asp:Button ID="btnSave" runat="server" Text="Save" OnClick="btn...

Relogin using different user , can access the previous user login page
Hi  there , I am using ASP Net 2.0 and its login controls. I face security loophole in which within the same IE Window, the 1st user access a page and left for long time. And the 2nd user click on it and get redirect to login page. The second user login and can see the last page that the 1st user left. Why ? Any workaround for this ? Thanks  Hi wkhwan, When the user logs in the second time, they will by default be send back to the page that they were previously on.  Note that they will be accessing the page as the second user ...

Using controls from pages, master pages, and user controls
How would I structure my site in this scenario: I'd like to use a dropdownlist all over my site, sometimes in a regular page, sometimes in a master page, and sometimes in a user control.  I wish to bind its events programmatically, so normally I would just put that in the codebehind.  However, I notice a lot of code duplication because I have to declare the control in everywhere, in my base page (which all my pages inherit from), in my base master page (which all my master pages inherit from) and in my base user control (which all my user controls inherit from).How should I be...

how can i access .ascx (user control) controls like textbox,label .... from .aspx page
 I have 2 textboxes in my web user control(.ascx).i need to set some value to those textboxes from my .aspx page how is it possible.any one plz help me..............................  waiting for your solution :-)  :-)   Thankyou in advance ,have a greate day>>>>>>>>>>>>>>>>  You can try something like this from your aspx page's code behind: Dim txtTest As Textbox txtTest = usercontrol.FindControl("textbox_name_on_control") txtTest.Text = "the text you need"  &nb...

How can I use server.transfer with-in a global navigation menu of a master page to show as to be coming from one page
I have a Master page with a pop-up master menu which allows an anywhere anytime functionality from form to form.  I use image buttons and server.trransfer to a new url in codebehind, with the intent of only one url showing up for everything.  I can make this work if I always come back to a main page.   What I am now trying to do is to be able start at the main page, click a url using the server.transfer to a different url (works fine this far), and then be able to click a url in the master pages pop-up menu to go directly to a new url without having to go back...

How to access one user control from another user control on same page
hi,I have two usercontrol on same page. 1.ascx and 2.ascx on abc.aspx . Now I need to access dropdown on 1.ascx frm 2.ascx . Plz help me how can i do this?I have tried Page.findcontrol but as a user control inherits usercontrol class and not page class . its not giving reference to proeprty Page.Findcontrol. I can do page.findcontrol on aspx page but I need to do it on ascx only.plz helpregards,max   Hi Max, you have to expose your DropDownList as a public property which lays inside usercontrol 1. Example: 1 class MyUserControl1 : UserControl 2 { 3 4 p...

Web resources about - show each user pages which can access, without using membership or roles - asp.net.navigation-controls

Polish European Union membership referendum, 2003 - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

Drivers of Facebook Shuttle Buses Eye Teamsters Membership
Facebook and several other tech companies in Silicon Valley provide shuttle buses to transport their employees, and according to The New York ...

NJ Membership (@NJMembership) on Twitter
Sign in Sign up To bring you Twitter, we and our partners use cookies on our and other websites. Cookies help personalize Twitter content, tailor ...

Membership Has Its Privileges
Right now, crossing one of the magical rep borders happens more or less unnoticed. People just gain the particular powers. Now, of course they ...

Membership Cards - a set on Flickr
... home Sign Up Explore Recent Photos The Commons Getty Collection Galleries World Map App Garden Camera Finder Flickr Blog Upload Sign In Membership ...

Calgary Public Library: New Look. New Library. Free Membership. - YouTube
CREATING THE WORLD’S BEST PUBLIC LIBRARY: NEW LOOK. NEW LIBRARY. FREE MEMBERSHIP. For Immediate Release: In a bold move to become the world’s ...

The benefits of private club membership in the UAE
Lifestyle membership clubs can offer cardholders exclusive leisure discounts across the Emirates. But there can be a big catch - you need to ...

New Brisbane Broncos CEO Paul White Flags Membership Drive
The coal executive taking over at the helm of the Brisbane Broncos has his eyes set on the thousands of fans who regularly turn up to home games ...

Joe Tripodi's ALP membership suspended
NSW ALP has suspended membership of Joe Tripodi amid a corruption inquiry.

Invite-only memberships expand at Canberra's sky-high lounge
... club &ndash; if they have been lucky enough to get an invite The 15th floor lounge billed as Canberra's most exclusive has quadrupled its membership ...

Resources last updated: 1/17/2016 9:18:03 AM