Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0How to check if module is editable from within module container?How to check if module is editable from within module container?
Previous
 
Next
New Post
2/11/2008 3:44 PM
 

I asked this in the Skinning forum some days ago (see this thread), but the answer I got there didn't work for me, so I'll try my luck here:

On my portal, I have some rather small modules with little content, which don't need a visible title. The title is required only for internal identification. But for users with edit rights it would be helpful to see the title as soon as they are logged in.

So I thought of checking programatically (with a little VB script in the module .ascx skin container) if the current user has edit rights, and set the title visibility with dnnTITLE.Visible = True/False.

Question:
AFAIK each module has an isEditable property, but I cannot figure out how to access that property from within the container. Any suggestions would be appreciated!

 
New Post
2/11/2008 7:47 PM
 

don't use vbscript, it's for asp, not asp.net. You can probably acheive this by adding an inline script block such as <%if me.isEditable then response.write("editable")%> , though I would suggest adding a a panel with content and enabling it's visibility from the ascx.vb e.g.

in the ascx

<asp:panel id=pnlEditVisible runat=server><strong>This is editable</strong></asp:panel>

in the ascx.vb

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

pnlEditVisible.visible=me.iseditable

end sub


Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
2/12/2008 1:38 PM
 

Thanks a lot for the answer! But I couldn't make it work, because if I put that code into my 'container.ascx', then the 'Me' in 'Me.IsEditable' refers to the page object, not to the module (and there is no 'Page.IsEditable' property, so I get an error message).

 
New Post
2/12/2008 3:31 PM
 

ah, whoops I read that wrong. IsEditable is a part of portalmodulebase, I thought you were injecting the content into the module, not the container. Perhaps you could iterate through the control collection of the container and if you find controls that inherit from portalmodulebase cast them to that and check the IsEditable property of that way.

Cathal


Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
2/12/2008 3:46 PM
 

OK, I'll try that. Thanks again!

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0How to check if module is editable from within module container?How to check if module is editable from within module container?


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out