ASP.NET - How to efficiently create dynamic user-specific menu from database - asp.net

this is my first time posting on StackOverflow but this site is awesome. Thanks in advance for any help you're able to give.
I have a site which gives users access to different pages based on their permissions so each user needs to have their menu dynamically generated when they log in. However, a user's options probably won't be changing very often.
The site currently has a Master page which pulls a list of their pages from the database and builds a menu. It does this each time the user loads a page.
I wanted to cut down on calls to the database so started putting the menu data into a Session variable. I was hoping someone more experienced could help me out in making sure that this is the best way to do it. I think I would prefer a way to store it on the user's machine and not the server.
I have this is my Master's Page Load:
User u = new User(Page.User.Identity.Name, Globals.getCnString());
DataTable menu;
if(Session["MENU"] == null)
{
Session["MENU"] = u.getMenu();
}
menu = (DataTable)Session["MENU"];
foreach (DataRow r in menu.Rows)
{
//build menu code here.
}
Thanks again!

If user's options won't be changing very often, why don't you build the menu only when the change happened, save it in user's profile table (in html format), and pass it to a literal control in the Master page instead of the menu, in that way you'll not store it on the user's machine(which is not recommended for a website).

Create an XML file with the list of URLs. For each URL element, add an attribute for permissions and base the visibility of each link on that.

Related

How do I create a new page for each user?

I need to create a new page for each user on signup so when you go to the site's explore page and click on someone's name or picture, it will take you to their specific page and display their data. (database is firebase firestore and firebase storage, saved link to each person's doc)
This is one of the issues I've been trying to fix for about a month(just fixed the explore page issue and got everyone profile pic to display with that individual user's name right below). I have tried making a new html page with someone's php and js script (didn't work, not familiar with php) and url rewriting.
I haven't been able to find anything else concrete or at least something else to point me in the right direction. Any pointers or tips?
(Vanilla/node.js)
With PHP, on clicking a persons username you can add the username as a parameter to the url e.g yoursite.com?user=personsusername then use GET method to retrieve the username and output data relating to that username from the database

let wordpress create new page with users content

I am wondering what would be the best way to let wordpress create idivual pages :
the project is as followed :
User makes account
Wordpress creates account and an account page, this page however is completely different from the wordpress theme. (easy i know, You could compare it with a profile page for the user but with much more content to fill in)
after user has filled in additional content wordpress should create the new page with the specific page design. Users should be able to edit content afterwards. Paying users should be able to export the generated page. Pages should be visible for public and be like domain.com/user
I am not sure how the best approach would be for this project as i am not that familiar with wordpress. My first thought is trough a childtheme, but im not sure if this would work.
Any advice?
Kind Regards
Try BuddyPress, this is exactly what it is designed for.

How to show webform submitted data in drupal7

i want to display the webform submitted data in drupal 7 and that survey only admin can see.After the submission i want to show the submitted data to admin in table format and also wants to download that data in excel Sheet format. What approach i should follow.
you can call this function which is called after the data is inserted in the webform.
This hook will provide you the node id and and the submission id. Using this submission id you can access all the data which you have inserted and can perform your task inside it.
function hook_webform_submission_insert($node, $submission) {
//do your task
}
Install this module http://drupal.org/project/webform_report it will be displayed in table format and also you can customize the report & also It will create separate content type.
Below is the screen shot for webform report, you can also view, edit & delete from report itself.
hope your requirement will match this!!!
Hmmm.. I thought the native table generator pretty functional. It includes a download button.
login as admin, then go to: Content --> Webforms Tab --> Your webform --> Submissions (or better = TABLES ! ) to see what the users have submitted. At the far right side of the TABLE display is a download button. With this selection you get EVERYTHING downloaded in a convenient XL sheet.
I know I'm a late comer to this party, and perhaps this enhancement is a late addition to the software. Solution offered here to aid others in the future.

wordpress user management, how to assign specific page to each user?

I want to create pages in WordPress, which should show to a specific user only not for specific role.
if a page is created for a specific user like "john". it should be viewed by only john, no other users could not see that page.
My Questions are:
How to create a page for a specific user? (from admin).
Note: while creating page we should assign that page to specific user like "john".
Is there any plugins for this?
Is there any way to do this.
-Srikanth.
I know that it is a bit late but still want to answer in case you need. Try to use http://wordpress.org/extend/plugins/user-specific-content/ plugin. You can customize your pages.
Just an idea:
Why not make a page template for that page? get current user id in the template then show the details depends on the user id? You can check is_user_logged_in() and pull all contents under the if statement and under the else statement you can redirect the user to the login page or just show the message to logged in.
Let me know if everything is clear. Thanks!
This can be done with ease using nav menu plugin and roles creator plugin.you can create roles with names of your clients and show menu items of user pages to specific roles/person

How I can add "files available for download" to Drupal user profile page

first time here. I have searched all day for my particular issue with no luck.
I have users that have specific roles auto generated (they purchase a game). I want to display files available to their particular role on their user profile page. I just want to know how I can add a generic view or associate a panel with user profile pages. I want this to display for every user, not on a per user basis. Basically it'll act like, say, direct2drive, you log in and go to your user profile basically and see what games you bought. Seems simple but I am having a heck of a time figuring out how to do this.
I am pretty used to using views but I just don't get how to edit the user profiles like I want to.
Thanks!
The simplest way is to install views_attach, and create a view with a Profile display. This displays the View on the user profile pages, rather than on its own page or in a block, and will pass the user's uid to the View as an argument.
Alternatively, if you're already using comfortable using panels, you can go to admin/build/panels and enable the Users panel. This replaces the user profile page with a panel, which you can add views, nodes and blocks to as normal.

Resources