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.0EditUrl() and ItemIdEditUrl() and ItemId
Previous
 
Next
New Post
2/20/2008 2:37 PM
 

Ok, so I have a question about how a module works...

In my module's table, I have a ModuleId (which corresponds to the ID for the module instance in DNN I believe) and an ItemId (Which is the primary key for the table). I began this module as a StarterKit module, so imagine my surprise when I notice that the Edit control link doesn't actually work. The reason being the edit control expects ItemId to be passed by query string. It isn't, of course, because the added action is simply EditUrl() and not something like EditUrl("ItemID", ItemID.ToString).

So my questions are these:

1. Do I really need to use the ItemId at all, or can I just key on ModuleId and forget about ItemId?

2. Should I pass ItemId (that is, use it), and if so HOW do I do this. None of the online docs help here. This is because the action is added on page_init, and the only place I can see to get this is when you load in the module info in page_load. So is there another place I can get it to pass at page_init in the following function?

        public ModuleActionCollection ModuleActions
        {
            get
            {
                ModuleActionCollection Actions = new ModuleActionCollection();
                Actions.Add(this.GetNextActionID(), Localization.GetString(ModuleActionType.AddContent, this.LocalResourceFile), ModuleActionType.AddContent, "", "", this.EditUrl("ItemID", ), false, SecurityAccessLevel.Edit, true, false);
                return Actions;
            }
        }

3. Is this a problem with the starterkit? Because it seems to me that its broken out of the box then.

Michael

 
New Post
2/20/2008 5:30 PM
 

Hmm looks likethere may be a problem. See:

IActionable: Add Items to Your Module Menu (VB &C#)



Michael Washington
http://ADefWebserver.com
www.ADefHelpDesk.com
A Free Open Source DotNetNuke Help Desk Module
 
New Post
2/21/2008 10:37 AM
 

This is by default.

The edit page can perform in one of two ways.

1.) If no item id is passed it is in "add content" mode.  This is the way it is liked via the Action menu as it is an add content link

2.) If an item id is passed it is in "edit content" mode.  This is the way that the "edit" icon is linked next to each individual content item that is rendered to the page.


-Mitchel Sellers
Microsoft MVP, ASPInsider, DNN MVP
CEO/Director of Development - IowaComputerGurus Inc.
LinkedIn Profile

Visit mitchelsellers.com for my mostly DNN Blog and support forum.

Visit IowaComputerGurus.com for free DNN Modules, DNN Performance Tips, DNN Consulting Quotes, and DNN Technical Support Services
 
New Post
2/21/2008 11:11 AM
 

I understand that part. The code is pretty obvious on that note. The problem is an ItemID is NEVER passed by definition. No matter what, the action is just passed the EditUrl(). So there is NO code path where ItemId is passed, and thus, you will NEVER get into edit mode, only add mode. Further more, because ItemId is never passed, Delete, and Update can never function.

Thus my issue. Because this Action is added on Page_Init, and the ItemID isn't even loaded in until Page_Load (When the module instance is retrieved), there is NO WAY to pass ItemID, and THUS the starterKit is broken by default, it would seem. Unless I am completely wrong somehow, in which case PLEASE enlighten me because I'm losing hair quickly...

==

As an aside, as a best practice, should settings for the module be stored in settings (TabModuleSettings table) or through an edit control such as this (Which would store it in the table for my module)? Or is it basically up to the designed and there is no specific rule of thumb of where to put stuff. It would seem that editable content should be done by the Edit control (Say, a reservation policy), and settings (Like the ID of an object to be passed to an external Web service for instance) should be set in settings. Just curious.

 
New Post
2/21/2008 12:02 PM
 

The edit functionality IS NOT done via the module action.  It is done via the ListView that displays the content items.  You have two distinct actions.

1.) Module actions for ADDING CONTENT ONLY.  This is why EditUrl() is all that is needed

2.) Edit links next to displayed content elements.  This is handled by the list view and the item templates.  This passes the item id.

--

Regarding settings it really depends onw hat you are doing.


-Mitchel Sellers
Microsoft MVP, ASPInsider, DNN MVP
CEO/Director of Development - IowaComputerGurus Inc.
LinkedIn Profile

Visit mitchelsellers.com for my mostly DNN Blog and support forum.

Visit IowaComputerGurus.com for free DNN Modules, DNN Performance Tips, DNN Consulting Quotes, and DNN Technical Support Services
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0EditUrl() and ItemIdEditUrl() and ItemId


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