C# - Create Pages With Different Permission's Views?

Feb 21, 2011

Don't get me wrong, I don't want anyone to write code for me, I just want to know what I'll need to implement. I'll detail what I need: Ex: Facebook page. If I'm at my profile's page I have one type of view, I can edit all my data, see even not set data and add more information. If I'm visiting a friend's page I can only see what he wants me to and interact with his pages as far as he allowed me.

Ex2: One user posted info on some blog. He and all the people with privileges can edit that info, the other can only read and post comments as their permissions allow. Was I clear enough? I wasn't able to find Google references because I don't know the name of this technique and the keywords I typed didn't take me anywhere.

View 1 Replies


Similar Messages:

C# - Create Pages With Different Permission's Views For Different Types Of Users?

Mar 3, 2011

I need to create different page views for different types of users. I already asked that here: How to create pages with different permissions' views And even though Aldeel's answer works, it does not seem the best solution for me. I'll explain why. I need to show different views but it's not only like that. Each user can have access to different parts of the page.

Imagine a page 'X' with this structure

Field A
Field B
Field C
Field D

When user U1 from group G1 visit page X the system checks the DB for that group's permission on page X. User U1 can see Field A and Field B, but only edit Field A. User U2 that is set to no group visits page X. The system checks for his permissions on page X. User U2 can see and edit all fields. When user U3 from group G2 visit page X the system checks the DB for that group's permission on page X. User U3 can see Field C and Field D, but can not edit any.

I coudn't find a way to do that instead of filling ViewData with lots of data about that specific user's permission. In my example there are only 4 fields, but in my current project I have no screen with less than 20 fields. So I guess you can see how ugly and not productive that is. The idea is similar to a social network, as I said (facebook example). When a user visiting UserX's page can only see what UserX has allowed him to.

View 2 Replies

SQL Server :: Auto Give Select Permission To New Views?

Dec 25, 2010

I have restricted the web login used by my ASP.Net pages to only run procs and pull data from views, it never has direct access to tables. My problem is if I add a new proc or view I have to modify the login's permissions to give access to the new items. Is there some way I can set the login to automaticly have the correct permission to new views/procs I add?

View 2 Replies

How To Link Layout Pages To Views MVC 3

Apr 4, 2011

I have a layout page (or master page) with MVC 3 and would like to make my views sort of content pages to this layout page, but alas I have no clue how to do this.

View 2 Replies

Security :: Create Folder And Set Permission?

Nov 10, 2010

I develop one application that create folder with special permission.

It works, but when I install the application on server I can't set any permission.

I think because it needs domain admin to set this permission... I've one account of one domain admin but how can I do to impersonate when the application set (try to set...) the permission ?

View 2 Replies

Architecture :: Use Separate Pages Or Make One With Multiple Views?

Nov 15, 2010

I'm working on a webforms aspx app (not MVC) and I'm not sure if I should just create separate pages or somehow make multiple views on the same aspx page for the following scenario: Basically, I need to give the user the option to view a set of data a few different ways (essentially different group by's from a data perspective)... the data is always the same, its just a matter of how to arrange on the page...

each way I need to present the data will essentially consist of 2 repeaters, one nested inside the other. The outer repeater will display a nice header section with the nested repeater showing the list of items under that heading. view by book title (title is outer repeater, with the book list being the nested repeater, yes, multiple books with same title for this example - the app has nothing to do with books, this is just to illustrate)

Book Title: A Good Story
Author - Publisher - ISBN
Dan Johnson - Smith Publishing - kjdkjfd99898989
Susan Day - Smith Publishing - aa777fd99ff
Greg Greger - Corp XYZ - amkj897hgrt554

Book Title: Another Good Story
Author - Publisher - ISBN
Frank Franky - Corp XYZ - kj3kjfd9d9980
Jason Cambel - Smith Publishing - 7g7fddddttt
Jill Breker - Smith Publishing - d9ddt523321

Or, view books by publisher (here the publisher would be the outer repeater and the list, with different fields compared to first view, is the nested repeater.

Publisher: Smith Publishing
Title - Author - ISBN
A Good Story - Dan Johnson - kjdkjfd99898989
A Good Story - Susan Day - aa777fd99ff
Another Good Story - Jason Cambel - 7g7fddddttt
Another Good Story - Jill Breker - d9ddt523321

Publisher: Corp XYZ
Title - Author - ISBN
A Good Story - Greg Greger - amkj897hgrt554
Another Good Story - Frank Franky - kj3kjfd9d9980

so what do I do here? Just making separate pages is simple and would work, but is there something else I should be considering? There will be 3 different views, so 3 pages total if I went that route. Something is making me think I should be doing this all within one aspx page? maybe just toggling the visible property of the repeater controls? but then I was thinking each of these repeater controls is databound, and I assume even if they are not visible they still incurred database hits to get the data, right? and that could be bad?

View 4 Replies

C# - Create Folder Programmatically In DotNetNuke And Assign Permission To It?

Feb 7, 2011

I have created a folder in DotNetNuke programmatically on the root portal directory. I just want to assign permissions to it only one time, for example I want to make it read only for authenticated users. Any advice on how to accomplish this using C# or VB.NEt?

View 1 Replies

Web Forms :: Permission Denied To Create XML File In Web Application?

Nov 12, 2010

I have a web application with a textbox and a button. When i click the button with a folder name in textbox a .xml file should be created in C: folder getting all the data from a method which retrives data from DAL. But clicking on button gives the error of access denied. I dont have sufficient permission. But when i run visual studio as administrator, this permission error does not occur, instead some other error i get. How can i get this permission to run this application?

View 3 Replies

C# - Possible With ASP.NET Master Pages To Create Content Pages Dynamically?

Jan 22, 2010

Is it possible with ASP.NET Master Pages to create content pages dynamically?That is, I know we can create content dynamically, but the content pages themselves,can those be created programmatically? I want to give my users the ability to define new content pages (i.e. Categories: Sofas, Tables, Lamps, and add/delete as they see fit) through a management panel. The resulting content pages should have proper URL naming, so that they index properly.An example: http://www.example.com/products/Lamps/contentpage.aspx.Is there a demonstration of this somewhere I can view?

View 4 Replies

Create Dynamic Views In Mvc 2.0?

Mar 17, 2010

How to create dynamic views in asp.net mvc 2.0?

View 1 Replies

How To Create Shared Views In MVC

Jan 20, 2011

In my Views folder I have a several folders such as Category, Origin, Price. They all have a Browse.aspx file and the code in this file displays a table of products. All controllers associated with these folders use the same ViewModel, but in each view I have a repetitive code. The code is:

Folder Category, file browse.aspx
Folder Origin, file browse.aspx
.....

<% foreach ( var p in Model.Products) { %>
<li> <%: p.productname + " " + p.price + " " + p.origin.originname + " " + p.category.categoryname %> </li>
<% } %>

How can I create a shared view and use the shared view in all these views?

View 1 Replies

MVC :: Checkboxes With 2 Create / Edit Views

Oct 25, 2010

I'm currently writing a game review site in MVC 2. I'm having some problems both figuring out exactly what to use as my view models and how to display checkboxes in my form for a many-to-many relationship. My main models generated by EF4.

The biggest problem at the moment is trying to figure out how to create checkboxes for a game's platforms. There's a many-to-many relationship between games and platforms - each game can be available on a number of platforms (PS3, XBox 360, etc.), and each platform has a library of games. In my Edit view, I need to list all of the platforms and have the ones the current game is listed for checked. I have the following view model:

[Code]....

So, I need to list all of the view model's Platforms while putting a check mark in the GameData's platforms.

View 1 Replies

MVC :: Create Completely Dynamic Views?

Jul 30, 2010

I want to create a complete dynamic view engine in that absolutely all html content will be loaded from a database. This is so I have a templating engine that is totally customisable. I have something similar in classic asp and the way that works is with fillpoints so you have a master page html which will just be a string when extracted from the database and then content is dynamically added to the string to sections identified by a fill point. So for example I have my master page content loaded into a C# string and I want to load a main view and a partial view onto the page, how would you go about that in MVC? I guess I would have to keep the fill point idea as there is no other way to know where the content will go. I'm just after opinions from the community really on how to go about it.

View 3 Replies

MVC :: Create Partial Views In View?

Feb 22, 2011

I want a view that contains 2 partialviews. 1 partial view should be a create or edit view (of items) and in the second partial view there should be a list with the items that are created (and which can be edited). When an item in the list is selected for editing the 1st partial view should show the edit view with the item to be edited.

After saving the data, the create view should be shown in the 1st partial view again. When the view comes up for the first time the 1st partialview should contain the create view. In normal ASP.net I would do this with a formview (with insert and edit mode based on the itemselected in the gridview) and a gridview (and of course everything in an AJAX update panel).

View 2 Replies

MVC :: How To Create Partial Views Using The Razor Engine

Jan 20, 2011

Using the Razor engine how do I create Partial Views. Do I create a normal View and calling the PartialView() in the controller will only output the body content and when calling View() in the controller will output the full page with layout. If not, do I need to create specific Partial Views and then use RenderPartial in the View.

View 6 Replies

MVC :: Create Views That Perform Multiple Tasks?

Oct 3, 2010

This is my first forray into ASP.NET MVC, having been doing WebForms for nearly 6 years now. I've read through various tutorials and guides on getting started with MVC, but I've a few questions about how you're meant to do things:

UserControls for entities

In an application I wrote a few years ago (using WebForms) there were many entities that had an associated postal address (which existed as an instance of an Address class), so I created a UserControl that contained fields for working with addresses. During the page lifecycle I would pass the business object's .Address property to the UserControl for display and for population upon a successful and valid postback. How would I do something like this in MVC? My current project has a similar situation where common sets of fields are repeated throughout the application and all 'map' to the same class.

Modifying the page/view on 'postback'

Say I'm working on a data-entry form for an online B2B ordering system, where the user manually enters order items into a series of textboxes arranged in a table. The system can only provide so-many textboxes at a time (usually 5 or 10). If the user ran out of textboxes they would click an "Add more rows" button that performed a postback that was caught by that button's server-side .Click event handler. The page's class would then add more rows to the page; ASP.NET's stateful nature made this easy to implement. But in MVC there is no ViewState and I haven't found much information about how you'd do this, or anything like this. All of the tutorials and guides assume a form posting is only for data submission.

Multiple tasks per page/form

In a similar vein to the above, how do you create views that perform multiple tasks? In my above example I cited a webform that had two buttons: one to submit the form for actual processing, and another button that just modified the page (by adding more data-entry rows).Given that Controllers' actions are bound to URIs rather than what combination of fields were submitted, does this mean that I would have to interpret the posted data myself and branch based on that?

Componentised self-contained controls (e.g. sidebar forms)

Finally, in many web applications you have the main form in the middle, but also things on the periphary of the page (e.g. a sidebar) that might have their own logic. For example, in one WebForms application I wrote last year there was a 'Quick contact' form in a UserControl located elsewhere on the page. When the user clicked the form's button the UserControl's logic handled the postback details independently of the page containing the UserControl (but there was only one <form> element in the whole rendered page). The user was returned to the page they clicked the button on, with everything in identical state as to how it was before, exccept for the UserControl which reported that the email was sent. Again, MVC's stateless nature would make something like this hard to implement, unless there are some techniques not covered in the tutorials?

View 2 Replies

MVC :: Create Multiple Views For Essentially The Same Type Of List?

Jan 31, 2011

If I have a View for 'People' and a View for 'Company' and each has an associated list of 'Orders', should there be a separate view for each? Such as /People/Orders and Company/Orders, or should I simply have a single /Orders views and pass in some parameters?

View 9 Replies

Primary Key In A Partial View Shared By Create And Edit Views

Jul 13, 2010

I have a partial view (user control) that is shared by my Create and Edit views. When I use it in the Edit view, I have to to include an hidden field (Html.HiddenFor) to prevent a 'Row changed or not found' error in my data service, but when I use it in the Create view, I have to remove the PK hidden field, to prevent an error over trying to insert into an identity column. It is not feasible to not use identity columns in this application, so how can I 'switch' that PK hidden field on or off depending on which action has been invoked?

Post Action Code:

[HttpPost]
public ActionResult Edit(JobCardViewData viewData)
{
try
{
jobCardService.Update(viewData.JobCard);
Edit View Excerpt:
<% Html.RenderPartial("JobCardInput", Model); %>
Partial Excerpt:
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<Poynting.Installation.Web.ViewData.JobCardViewData>" %>
<% using (Html.BeginForm())

View 2 Replies

C# - How To Create Create Variables / Properties In Master Page And Let Sub-pages Access Them

Apr 14, 2010

How to create create variables/properties in master page, and let sub-pages access them? So my master will have a string property HomeUrl How can any page that uses the master page access this property?

View 2 Replies

Northwind (SSMA) - Create A Query In SSMS And Then Set Up Master - Detail Views

Aug 31, 2010

I'm trying this example: [URL] I got it to work before, like 6-months ago. I'm coming back to this now and I can't seem to get the example working. Do I need to create a query in SSMS and then set up my Master/Detail views off of that? It seems like the GridView is NOT linked to the DropDownList and it seems like there is no way to link the two Objects.

View 2 Replies

MVC :: Create View With Partial Views But Submit Button Doesn't Work

Jan 11, 2011

i created a "create" view for creating a new record of my used model. The View includes partial views with the editor-fields. But the "Create" submit button doesn't work. When i copy the editor-fields to the create view without using partial views the submit button works. Here is my code: Create.cshtml

[Code]....

View 5 Replies

SQL Server :: Windows Shared Hosting Error: Create Database Permission Denied In Database 'master'?

Mar 1, 2011

how I can correct an error. I've built the MVCMusicStore tutorial here:

http://mike-ciccone.com/Store/

The first time I visit the site and attempt a database connection I get this error:

Exception Details: System.Data.SqlClient.SqlException: CREATE DATABASE permission denied in database 'master'.

But when I refresh, it all works fine. I'm at a bit of a loss. I don't believe I'm attempting to create a database, but I realise that the error may not really have anything to do with that. This is hosted at GoDaddy shared hosting. The database was created and I used an SQL script to create the tables initially and populate the data. My connection string works as I can pull data from the database, but I do have
a feeling it will be a web.config setting that will correct this.

View 3 Replies

Security :: Create And Write File In "C:windowssystem32" This Path / Want Some Code In C# Who Give The Permission To Folder?

Oct 7, 2010

I want to create and write file in "C:windowssystem32" this path.some computer give the error access denied.i want some code in C# who give the permission to folder.

View 5 Replies

Added 5 Views In The MultiView But All Views Are Tight Together?

Sep 28, 2010

I am learning MultiView control.Here are question:I added 5 views in the MultiView but all views are tight together. I can not drag and drop another control such as text boxes or labels into view area.

View 15 Replies

MVC :: Cannot Assign Timespan Display Format Attribute On Create/Edit And Display Views

Jul 6, 2010

inside my model metadata, i have a timespan field that would like to display in all Create, Edit and Display views like "hh:mm". For this, is set DisplayFormatAttribute as follows:

[Code]....

When i try to create a new model object, the time field gets displayed as "00:00:00" im my model (00 is the initial values) instead of "00:00". Is there something i am doing wrong? Note that the same approach works for date fileds, where i want to be displayed as "dd/MM/yyyy" (for this is assign "{0:dd/MM/yyyy}" to the display format attribute).

View 4 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved