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  |  

  Need Help?  
Professional technical support for DotNetNuke is available from DotNetNuke Corporation.
 


  Ads  
WebHostForAsp.net
 


  Sponsors  

Meet Our Sponsors

The Official Microsoft ASP.NET Website
Portal Webhosting - Hosting For Developers
Red-Gate Software
MaximumASP
SourceGear - Tools for Developers
.: CounterSoft :.
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Extend It! ( Pr...  Need Help Programming Module in C#
Previous Previous
 
Next Next
New Post 5/19/2006 8:50 AM
User is offline Matthias Schlomann
1198 posts
www.taunusstein.org
6th Ranked








Need Help Programming Module in C# 

Hello I am on Programming a Module für Shoutcast Server info.  And I have a Problem with the settings.aspx.cs

I have to post 3 Module settings.  But in the example is onli one providet.  Now I think have a Problem with the Catch, and Module controller.

Here is the code.

 */

using System;
using System.Web.UI;

using DotNetNuke;
using DotNetNuke.Entities.Modules;
using DotNetNuke.Services.Exceptions;

namespace YourCompany.Modules.ShoutcastStats
{
    /// -----------------------------------------------------------------------------
    /// <summary>
    /// The Settings class manages Module Settings
    /// </summary>
    /// <remarks>
    /// </remarks>
    /// <history>
    /// </history>
    /// -----------------------------------------------------------------------------
    partial class Settings : ModuleSettingsBase
    {

        #region Base Method Implementations

        /// -----------------------------------------------------------------------------
        /// <summary>
        /// LoadSettings loads the settings from the Database and displays them
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <history>
        /// </history>
        /// -----------------------------------------------------------------------------
        public override void LoadSettings()
        {
            try
            {
                if (Page.IsPostBack == false)
                {
                    if ((string)TabModuleSettings["Server"] != null)
                    {
                        Server.Text = (string)TabModuleSettings["Server"];
                    }
                catch (Exception exc) //Module faild to load
                    {
                if ((string)TabModuleSettings["Port"] != null)
                    {
                        Port.Text = (string)TabModuleSettings["Port"];
                    }
                }
            catch (Exception exc) //Module faild to load
            {
                if ((string)TabModuleSettings["Pass"] != null)
                    {
                        Pass.Text = (string)TabModuleSettings["Pass"];
                    }
             }
            catch (Exception exc) //Module failed to load           
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }
        }
    }


        /// -----------------------------------------------------------------------------
        /// <summary>
        /// UpdateSettings saves the modified settings to the Database
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <history>
        /// </history>
        /// -----------------------------------------------------------------------------
        public override void UpdateSettings()
        {
            try
            {
                ModuleController objModules = new ModuleController();
                objModules.UpdateTabModuleSetting(TabModuleId, "Server", Server.Text);
            }
            {
                ModuleController objModules = new ModuleController();
                objModules.UpdateTabModuleSetting(TabModuleId, "Port", Port.Text);
            }
            {
                ModuleController objModules = new ModuleController();
                objModules.UpdateTabModuleSetting(TabModuleId, "Pass", Pass.Text);
            }
            catch (Exception exc) //Module failed to load
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
           
        }

        #endregion

    }
}


Please Help

Thanks

Matthias


Regards
Matthias
www.moonlightradio.net
 
New Post 5/25/2006 12:02 PM
User is offline Michael Flanakin
994 posts
www.michaelflanakin.com
7th Ranked




Re: Need Help Programming Module in C# 
The code you have shouldn't even compile. Try having a look at one of the core modules. The source is provided on the project downloads page for the respective project. Check out the Links Module, for instance - it uses 3 or 4 settings, I believe.

Michael Flanakin | Microsoft Consulting Services
www.michaelflanakin.com
 
Previous Previous
 
Next Next
  Forum  General DotNetN...  Extend It! ( Pr...  Need Help Programming Module in C#
 


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.

 


Disgrafic
Diseño y creación de portales web dinámicos :: Desarrollo de módulos personalizados :: Soluciones a medida :: Imagen Corporativa :: Tu proveedor DNN en España
www.disgrafic.com
DM Analytics, LLC
DM Analytics, LLC provides software solutions that facilitate rapid development of independent or dependent datamarts and their associated web-based reporting.
www.dmanalytics.com
Integral Hosting | DNN only $14.95/month
Experienced .NET hosting on Windows 2003, ASP.NET 1.1 & 2.0, MSSQL with real technical support.
www.integralhosting.com

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