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.0controlling the dnnActionButton link - Add contentcontrolling the dnnActionButton link - Add content
Previous
 
Next
New Post
1/14/2006 1:30 PM
 

Greetings,

I have written several custom modules, that are part of one intranet application on the same page.  Most of the users will be allowed Update privilege. However, upon arriving, we want them to do *our* (custom) "Search" (a button in the 1st module) before we allow them to Add new (to avoid duplicate information).

So, although they have the privilege, I really want to control when an "Add" link is displayed (i.e. after they have hit our custom Search button).  How do I hide the default link? (i.e. __doPostBack('dnn$ctr123$dnnActionButton1$lnk4')   What might be some good approaches for this.

Thanks, in advance..    -Michael 

 
New Post
1/14/2006 8:14 PM
 
My approach would be to place custom logic in the "ModuleActions" property that would only Add the "Add" action IF certain conditions were met. 

Alternatively, you could Add the Action item, but set the Visibility parameter to CanDisplay where CanDisplay is your own logic that returns a boolean True/False depending on whether the user should be able to see the Action Menu item.

Charles Nurse
Chief Architect
Evoq Content Team Lead,
DNN Corp.

Want to contribute to the Platform project? - See here
MVP (ASP.NET) and
ASPInsiders Member
View my profile on LinkedIn
 
New Post
1/14/2006 8:15 PM
 

Assuming you don't want to develop your own control panel (which is the more elegant way to do this), you could just write a skin object that does whatever checking you need, and then does something like:

Ctype(Me.page.FindControl("IconBar.ascx_cmdAddTabIcon"), System.Web.WebControls.HyperLink).Style.Add("visibility", "hidden")

This is just an idea, I haven't actually tried it, and it's a pretty crude solution, but it might work for you.  Like I said, the elegant solution is just to write your own control panel and do the checking and disabling of the add button there.


 
New Post
1/17/2006 4:29 AM
 

I have the same problem in DotNetNuke 3.2.0 - we have two modules on the page, Module1 is a selector, Module2 is a view. I want Module2 to enable/disable the Action depending on what was selected in Module1. The problem is that ModuleActions() is called before Module1.Load - and so the session does not contain the updated values. (I could use Intermodule Communication, but I would rather not)

So: My question is - how can I set this CanDisplay - or is that an ASP.NET 2.0 feature?

 
New Post
1/17/2006 11:54 AM
 
CanDisplay was a suggested name for a function you would create.

Anyway to get over the syncronisation issues - how about using Module1.Init ?

Charles Nurse
Chief Architect
Evoq Content Team Lead,
DNN Corp.

Want to contribute to the Platform project? - See here
MVP (ASP.NET) and
ASPInsiders Member
View my profile on LinkedIn
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0controlling the dnnActionButton link - Add contentcontrolling the dnnActionButton link - Add content


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