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  |  

Affordable ASP.NET Hosting Service
  Need Help?  
Professional technical support for DotNetNuke is available from DotNetNuke Corporation.
 


  Ads  
Iron Speed Designer is a software development tool for building database, reporting, and forms applications for .NET without hand-coding.
 


  Sponsors  

Meet Our Sponsors

AspDotNetStoreFront - E-Commerce by Design - The Leading ASP.NET shopping cart platform for developers!
Click here to go to dev.live.com for Windows Live developer resources
SteadyRain
DataSprings - Great Ideas. Always Flowing.
R2integrated - formerly bi4ce
Jango Studios - Skins, Modules and Hosting for DotNetNuke
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Extend It! ( Pr...  Creating Module - Problem getting values to & from DB
Previous Previous
 
Next Next
New Post 7/8/2008 10:32 AM
Unresolved
User is offline RDO
39 posts
10th Ranked


Creating Module - Problem getting values to & from DB 

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 4:42 PM
User is offline William Severance
676 posts
www.wesnetdesigns.com
7th Ranked






Re: Creating Module - Problem getting values to & from DB 

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
 
Previous Previous
 
Next Next
  Forum  General DotNetN...  Extend It! ( Pr...  Creating Module - Problem getting values to & from DB
 


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.

 


Subzero Solutions
Dutch / English DotNetNuke consultancy services. Custom module development in any version. Complete application integration. Small business portal hosting. Your ideas our innovation - Your success our motivation. K.v.k Amsterdam: 34236342
www.subzero-solutions.net
Hosting for DotNetNuke
SiteGround.com is the best place to host your DotNetNuke website! Expert DotNetNuke support, reliable servers, low price!
www.SiteGround.com
Code Endeavors, LLC
Do you Endeavor to Enhance your DotNetNuke designs by utilizing AJAX technologies to more efficient interactive web experiences
www.codeendeavors.com

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