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