Hi all,
Before I explain the question, let me explain what I have setup so far. I have a single Module Definition with three controls defined:
Key |
Type |
Title |
SourcePage (abbreviated) |
|
View |
Items |
ViewItems.ascx |
Edit |
Edit |
Edit Item |
EditItems.ascx |
Settings |
Edit |
Item Settings |
ItemSettings.ascx |
In the ViewItems.ascx, I add a custom action in the usual event handler. The only "pertinent" code in that handler is:
Dim Actions As New Entities.Modules.Actions.ModuleActionCollection"", "", EditUrl(), False, Security.SecurityAccessLevel.Edit, True, False)
Return
So, When I add the module to an actual page, the default View controntrol is displayed, and its Title is "Items" (as expected and desired)
When I hover over the action menu, I get an option for "Add Item" (as expected and desired)
When I click the Edit link for one of the Items, I see the Edit Control displayed, and all the fields filled in and the Title of the Module is "Edit Item" (as expected and desired)
However, if I click on "Add Item" from the View Control, I am put onto the Edit Control with all the fields being blank (as expected), but the Title of the module is "Edit Items"......which is not what I want. I want it to be "Add Item"
If I change the title in the control definition it affects both modes so that won't work.
I've read the previous posts about how to change the module title in the Page_Load event etc, but what I am unclear on is how I know whether I am "Adding" or "Editing" at any given time.
Would it be simpler to actually make two different control definitions with different titles, but using the same .ascx page?
I appreciate any guidance all you experts can provide!
Thanks
Paul Hermans
Public ReadOnly Property ModuleActions() As Entities.Modules.Actions.ModuleActionCollection Implements Entities.Modules.IActionable.ModuleActionsGet
ActionsEnd GetEnd Property