Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

AppTheory specializes in solutions based on the DotNetNuke platform and has 2 employees on the DotNetNuke Core Team.
  Need Help?  
Professional technical support for DotNetNuke is available from DotNetNuke Corporation.
 


  Ads  
Aspose - The .NET & Java component publisher
 


  Sponsors  

Meet Our Sponsors

Red-Gate Software
MaximumASP
SourceGear - Tools for Developers
.: CounterSoft :.
telerik
ExactTarget email software solutions
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Extend It! ( Pr...  Module Title ?
Previous Previous
 
Next Next
New Post 4/25/2008 8:23 AM
Resolved
User is offline Paul Hermans
31 posts
www.benemtech.com
10th Ranked


Module Title ? 

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

 
New Post 4/25/2008 2:07 PM
User is offline Fuji Nguyen
192 posts
9th Ranked




Re: Module Title ? 

 Paul Hermans wrote

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.

 

Have you tried to change title in Page_Init instead of Page_Load in the Edit.ascx.vb? 

Try this:  Add a resource record for page title in the Edit.resx file and read the title from resource file at runtime and set the control title in page_init event. 


Fuji Nguyen
FREE Visitor Hit Counter
Visit opensource.indyneinc.com for detail.
 
New Post 4/25/2008 3:57 PM
User is offline Chuck Rizzio
122 posts
9th Ranked




Re: Module Title ? 
Modified By Chuck Rizzio  on 4/26/2008 5:51:18 PM)

Paul,

Most of the time I just determine the mode by looking at the value of the primary key field that is passed to the Edit control from the View control. Typically, when you click on the edit icon of an exiting record you pass the record id of the record clicked and when you click the "Add Record" link you pass a -1. If you have a table with a key field called "ItemId" you could do something like this in your Edit control in the Page_Load...

Visual Basic
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
If Not (Request.Querystring("ItemId") Is Nothing) Then
ItemID = Int32.Parse(Request.Querystring("ItemId"))
End If

If ItemId = -1 then
'-- Add mode.
Me.ModuleConfiguration.ModuleTitle = Localization.GetString("AddMode.Text", LocalResourceFile)
Else If ItemId > 0 then
'-- Edit mode.
Me.ModuleConfiguration.ModuleTitle = Localization.GetString("EditMode.Text", LocalResourceFile)
Else
'-- Invalid ItemId so just return.
Response.Redirect(NavigateURL(), True)
End If

This presumes you have entered the following entries in the resource file for your edit control... AddMode.Text "Adding Item" EditMode.Text "Editing Record" I hope this helps, Chuck R.

 
Previous Previous
 
Next Next
  Forum  General DotNetN...  Extend It! ( Pr...  Module Title ?
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, 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 DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


SteadyRain
Founded in 1999, SteadyRain has extensive experience delivering Internet technology strategies and solutions for a diverse client base, ranging from Fortune 500 firms to successful start-ups.
www.steadyrain.com
AfterImage Internet Consulting and SEO Services
AfterImage provides search engine optimization (SEO), Internet consulting and hosting services for the Windows platform (IIS, ASP, SQL Server).
www.afterimage.nl/
Willhite & Sharron Realtors
Exemplary service for your Seattle Real Estate needs. It's what you deserve from your Realtor®!
www.alkihomes.com

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP