Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Creating Module - Problem getting values to & from DBCreating Module - Problem getting values to & from DB
Previous
 
Next
New Post
7/8/2008 1:32 PM
 

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>&nbsp;<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>            &nbsp;
            <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>
&nbsp;<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>&nbsp;<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
    

 
New Post
7/8/2008 7:42 PM
 

The full name of your module class (including the namespace) is "DotNetNuke.Modules.ULDL_settings.DesktopModules_ULDL_Settings". However, in the @ Control directive you have:

Inherits = "DesktopModules_ULDL_Settings"

Change the value of the Inherits attribute in the @ Control directive to that of the full name of the module class (including the namespace).


Bill, WESNet Designs
Team Lead - DotNetNuke Gallery Module Project (Not Actively Being Developed)
Extensions Forge Projects . . .
Current: UserExport, ContentDeJour, ePrayer, DNN NewsTicker, By Invitation
Coming Soon: FRBO-For Rent By Owner
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Creating Module - Problem getting values to & from DBCreating Module - Problem getting values to & from DB


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, 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 DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out