I am trying to create a "Setting" for my DotNetNuke Module. I need to store a few values in the DNN DB, then be able to recall them in the Module. Below is the code & .vb for the setting page. Everything seems to be correct per everything i have read. The values for the txt boxes & dropdownbox's in the .vb are underlined in VWD & says "Name _____ is not declared". Also the "<%@ Control Language="VB" AutoEventWireup="false" CodeFile="Settings.ascx.vb" Inherits="DesktopModules_ULDL_Settings" %>" in the .ascx says "'Context' is not a member of 'DesktopModules_ULDL_Settings'.
settings.ascx:
<%@ Control Language="VB" AutoEventWireup="false" CodeFile="Settings.ascx.vb" Inherits="DesktopModules_ULDL_Settings" %>
<style type="text/css">
.style1
{
width: 100%;
}
</style>
<table class="style1">
<tr><td>School:</td>
<td><asp:TextBox ID="Setschool" runat="server"></asp:TextBox></td></tr>
<tr> <td>League:</td>
<td> <asp:TextBox ID="Setleague" runat="server"></asp:TextBox></td></tr>
<tr><td>Sport:</td>
<td> <asp:TextBox ID="Setsport" runat="server"></asp:TextBox></td></tr>
<tr><td>Subscription Price:</td>
<td><asp:TextBox ID="SetsubPrice" runat="server"></asp:TextBox></td></tr>
<tr><td>Subscription Term</td>
<td> <asp:DropDownList ID="SetsubTerm1" runat="server">
<asp:ListItem Value="1"></asp:ListItem>
<asp:ListItem Value="2"></asp:ListItem>
<asp:ListItem Value="3"></asp:ListItem>
</asp:DropDownList>
<asp:DropDownList ID="SetsubTerm21" runat="server">
<asp:ListItem Value="D">Day</asp:ListItem>
<asp:ListItem Value="M">Month</asp:ListItem>
<asp:ListItem Value="Y">Year</asp:ListItem>
</asp:DropDownList></td></tr>
<tr><td>Single Price:</td>
<td><asp:TextBox ID="SetsinglePrice" runat="server"></asp:TextBox></td></tr>
<tr><td>Single Term</td><td>
<asp:DropDownList ID="SetsingleTerm1" runat="server">
<asp:ListItem Value="1"></asp:ListItem>
<asp:ListItem Value="2"></asp:ListItem>
<asp:ListItem Value="3"></asp:ListItem>
</asp:DropDownList> <asp:DropDownList ID="SetsingleTerm2" runat="server">
<asp:ListItem Value="D">Day</asp:ListItem>
<asp:ListItem Value="M">Month</asp:ListItem>
<asp:ListItem Value="Y">Year</asp:ListItem>
</asp:DropDownList>
</td></tr></table><br />
settings.ascx.vb
Imports System.IO
Imports System.Web.UI
Imports System.Web.UI.Page
Imports System.Runtime.Serialization.formatters
Imports System.Collections.Generic
Imports DotNetNuke
Namespace DotNetNuke.Modules.ULDL_settings
Partial Class DesktopModules_ULDL_Settings
Inherits DotNetNuke.Entities.Modules.ModuleSettingsBase
Public Overrides Sub UpdateSettings()
Try
Dim objModules As New DotNetNuke.Entities.Modules.ModuleController
'Update Module Settings
objModules.UpdateModuleSetting(ModuleId, "school", Setschool.Text)
objModules.UpdateModuleSetting(ModuleId, "league", Setleague.Text)
objModules.UpdateModuleSetting(ModuleId, "sport", Setsport.Text)
objModules.UpdateModuleSetting(ModuleId, "subPrice", SetsubPrice.Text)
objModules.UpdateModuleSetting(ModuleId, "subTerm1", (SetsubTerm1.SelectedIndex).ToString)
objModules.UpdateModuleSetting(ModuleId, "subTerm2", (SetsubTerm2.SelectedIndex).ToString)
objModules.UpdateModuleSetting(ModuleId, "singlePrice", SetsinglePrice.Text)
objModules.UpdateModuleSetting(ModuleId, "singleTerm1", (SetsingleTerm1.SelectedIndex).ToString)
objModules.UpdateModuleSetting(ModuleId, "singleTerm2", (SetsingleTerm2.SelectedIndex).ToString)
Catch exc As Exception 'Module failed to load
ProcessModuleLoadException(Me, exc)
End Try
End Sub
End Class
End Namespace
values are called in the main module .ascx.vb as Dim school As String = CType(Settings("school"), String).ToString