Control of the page and the controls on a page

I am building a web app that has some pages that are public and some that are only available based on subscription.

Could someone explain the best way (infrastructure wise) how to control whether a server control is visible or enabled
and how to control whether a page is viewable or not based on the user and whether or not the user is logged in (or not).

If a user is not logged in I would like some controls to be visible but disabled. I also have to control the URL's in case a person learns
the URL and tries to type it in.

My question is more towards how to do this database wise. I am using ASP.NET 2.0 membership and can use roles, profiles and
personalization if necessary but I am not sure what the best practices are for this scenario.

Individuals can pay for a full subscription, and have full access to everything, but some users will subscribe to portions, such
as an online assessment or the ability to view a library.   Any ideas out there or sources to read about this?

thank you

0
transcend2004
9/17/2008 4:52:47 PM
asp.net.personalization 3779 articles. 0 followers. Follow

3 Replies
1361 Views

Similar Articles

[PageSpeed] 10

Are you using the Membership system?  You can do it via:

this.SomePanel.Visible = (this.User.Identity.IsAuthenticated);


Brian

"Trust in the Lord and do what is good; dwell in the land and live securely. Take delight in the Lord, and He will give you your heart's desires" (Psalm 37: 3-4).
0
bmains
9/17/2008 5:44:57 PM

 By controls, do you mean the Web Parts on the page?  If you give them properties that determine their access level, you can disable them or enable that way.

 Have you looked at all into custom CatalogZones?  That may be a good place to start.

0
bluerose
9/17/2008 9:19:06 PM

You can also give a WebPart an AuthorizationFilter value, and use this value to tap into the WebPartManager.AuthorizeWebPart event (http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.webparts.webpartmanager.authorizewebpart.aspx).


Brian

"Trust in the Lord and do what is good; dwell in the land and live securely. Take delight in the Lord, and He will give you your heart's desires" (Psalm 37: 3-4).
0
bmains
9/18/2008 1:16:48 PM
Reply:

Similar Artilces:

i have 3 pages student information , i filled two pages ,then go to 3rd page . First Two pages iam having 100 controls.how to store that controls and how to send these controls into 3rd page in ?
i have 3 pages student information , i filled two pages ,then go to 3rd page . First Two pages iam having 100 controls.how to store that controls and how to send these controls into 3rd page in ?  There are a number of ways storing values. Check out: http://msdn2.microsoft.com/en-us/library/75x4ha6s.aspxhttp://www.csharphelp.com/archives/archive207.html Thanks,Karan~ Remember To Mark The Post(s) That Helped You As The ANSWER ~ Hi, Welcome to asp.net forums. Now as far as your requirements goes, the first thing that strikes me is that 100 controls are way too many to kee...

Calling a method from a control page on the axpx page where the control page exists.
Hello,  I have an .aspx page that has a method called grdMain_DataBind().  I have a control page that loads within the aspx page which has its own logic.  I have a button on my control page called "SAVE".  How can I call the method grdMain_DataBind thats in my aspx logic from the control that exists on that page when I click SAVE button.  Is there a way? If I were you, I'd simply create a "Save" Event within your control. When the Button in your control is pressed, in the Click handler for that Button you can raise the event. Then, within t...

Content controls have to be top-level controls in a content page or a nested master page that references a master page.
Why in the world am I getting this error? The solutions I have seen either don't apply or don't work.  Here is my master page code:<%@ Master Language="C#" AutoEventWireup="false" CodeFile="TechLMSMasters/MainSide.master.cs" Inherits="MainSide" %> <%@ Register TagPrefix="usercontrol" TagName="Search" Src="~/library/uc/Search.ascx" %> <%@ Register TagPrefix="usercontrol" TagName="UserName" Src="~/library/uc/UserNameDisplay.ascx" %><!DOCTYPE html PUBLI...

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...

Error : Content controls have to be top-level controls in a content page or a nested master page that references a master page.
when I make a directory on my root, and in that directory I put a masterpage and a web form ... I get always an error : Content controls have to be top-level controls in a content page or a nested master page that references a master page.   Does somebody know what the problem is ? Is it possible you can't set a masterpage in a directory ... ?Kind Regards,Joeri Pansaerts.From Bruges, Belgium :) i've founded ... I had to nest my masterpage ...Kind Regards,Joeri Pansaerts.From Bruges, Belgium :) Hi Joeri Pansaerts, I am receiving the same error as the one posted her...

ERROR Content controls have to be top-level controls in a content page or a nested master page that references a master page.
This all used to work until about 5 minutes ago. Did I change something? For some reason I am now getting this error: Content controls have to be top-level controls in a content page or a nested master page that references a master page. What I have:  I have a masterpage inside of a directory. That directory is a first level directory with its own web.config file....The whole thing is protected by the web.config file above it (in the main public directory). That main public directory has a masterpage as well. I am not currently linking the two masterpages together becuase...

Tab Controls/tab pages/controls within tab pages
I give up! I have a tab control user object - inherited from u_tab - and some tab pages. Initially only one page is enabled which has a datawindow. When a valid data is entered in the DW, I need to enable rest of the tabs - Now - it is giving me a NULL object reference error during execution for the following statement in an event of the DW - tabcontrol.tabpage.enabled=TRUE getparent( ) also giving errors - HELP! How can I do this? Thanks! Ragni rpanjala@nsf.gov Ragni -- If you have CreateOnDemand set for the tab, then the tab pages are not valid until the user accesses them. ...

How to do post back in a dynamically created user control [provided that update panel is in the master page of the page where user control is added] {B/C of FileUpload Control}
I have a register my scriptmanager and place the update panel around contenttempalte for my pages int the master page. Now in one of my pages i am adding some user controls dynamically. In two of my user user controls I have FileUpload control which will not work under partial post back. So I want's full postback for them How could I do that {Provided that i am on the user control,which is inside the page ,and page have the contenttemplat...

Trying to use the FAQ " Sorting and paging in the GridView control when not using data source controls "Sorting and paging in the GridView control when not using..."
and I am not getting the results I had hoped for.  I keep getting a "Compiler Error Message: CS0123: No overload for 'AdhocJobGridView_PageIndexChanged' matches delegate 'System.EventHandler'".   Here is my event handling... protected void AdhocJobGridView_PageIndexChanged(object sender, GridViewPageEventArgs e){ try { AdhocJobGridView.DataSource = wsBaseInfoArray; AdhocJobGridView.PageIndex = e.NewPageIndex; AdhocJobGridView.DataBind(); }catch (Exception ex) {throw ex; }   Here is my aspx... <asp:GridView ID="AdhocJobGridView...

Problem to use TreeView Control in a 'content page' This Error Occur "Only Content controls are allowed directly in a content page that contains Content controls."
hi I am trying to use the TreeView Control inside the content page (Page that has a master page is a content page). On compiling the project I got the following ASP.Net runtime error: "Only Content controls are allowed directly in a content page that contains Content controls."B@b@R J Issue resolved. I was putting script tag in the content page that is not allowed. when remove the script from content page problem is resolved.B@b@R J...

Problem Accessing Page Controls in a page that has a master page.
Hi,  I have a problem with accessing the controls of a page that has a masterpage. I am trying to access the Page.Controls from the code behind in the class file but no controls are returned.I can access single controls (ex. txtAddress.Text) but not the whole array of controls (ex. Page.Controls).  The controls structure is..                                 MasterPage  >  PlaceHolder > MyPage.aspx &n...

How to access page control (editor control) from user control?
Hi, I want to do something, but I don't know if it's even possible. I'm trying to make a simple application to edit my website. I have a page called editPage.aspx which contains an editor control. (cuteEditor from cutesoft) I also have a Treeview that dynamically populates my website structure. I placed this treeview in a custom control (populateTreeView.ascx) and placed it on the editPage.aspx page. When you click on a html file in the treeview (inside the custom control) I check if the file exists. If it does exists I send it to a class which retrieves the editable region within this ...

Finding a control in the master page from within a control on the "child" page....
I've seen several examples of finding controls, but I'm struggling with this.  I want to turn a panel to visible and set a label's text field from within a control... All the examples that I've seen, including the really good one at MSDN2 shows Master.FindControl.  When I use that, it says Master is not declared.  Is there an easy way to set the panel and the label from within the control? Am I close? '---------- My Master page...abbreviated... <%@ Master Language="VB" CodeFile="Secure_Master.master.vb" Inherits="MasterPage" %><%@ Register TagPrefix="cc" TagName="men...

How to pass textbox control value from UserControl page(ascx) to Page Control(aspx).
I have 2 files(aspx and ascx). the aspx page  has a Web user control(ascx) in it.Once the button control click(in aspx) I want to get the value from the textbox(ascx) controland pass it to label control in aspx page.Can somebody help with this and please use VB.Thanks A simple search would have turn up many different solutions.  The easiest is to just expose the textbox value as a property in your control.  Then you can retrieve that value on the aspx page. Add this to your control: Public Property TextBoxValue() As String   Get   &...

Web resources about - Control of the page and the controls on a page - asp.net.personalization

Control - 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 ...

Now you can control your GoPro Camera from Apple Watch
One of the nicest features of the GoPro camera is the ability to control it using the iPhone app. With the GoPro App , you can easily control ...

Control a car's features with a glance? Not science fiction
Filed under: Emerging Technologies , Infotainment , Technology Press a button to change your car's climate controls? Turn a knob to view your ...

Arizona leaders welcome 'Leave No Child Behind' successor, less federal control
azcentral.com Arizona leaders welcome 'Leave No Child Behind' successor, less federal control azcentral.com The Senate gave final approval ...

FTC and healthcare cost control
... Pennsylvania, and lead to reduced quality and higher health care costs for the area’s employers and residents….the merged entity would control ...

Google seems more determined than ever to take control of Android
... to ad money. However, Google grabbed the lion’s share of the smartphone market by giving Android away. That means it lost the ability to control ...

How to control your iPhone by just tilting your head
... the best sight, hearing, or motor functions to still use iOS to its fullest capabilities — but they can also be used to customize your controls. ...

Fox Presents Ben Stein As An Awesome, Stupendous Gun Control Genius
Fox News host Neil Cavuto was super-impressed with “great writer and thinker” Ben Stein's opposition to gun control. “The problem is not gun ...

White House: We’re Not Going To Wait Until Something Happens To Pass Gun Control
Reporter: 'Where any of the recent mass shooters on the no-fly list?' Earnest: 'Not that I'm aware of'

The NFL Should Seize Control Of The Cleveland Browns
Drew Magary’s Thursday Afternoon NFL Dick Joke Jamboroo runs every Thursday during the NFL season. Email Drew here . Read more...

Resources last updated: 12/11/2015 2:35:39 PM