Wrox Programmer Forums
|
BOOK: Professional DotNetNuke Module Programming ISBN: 978-0-470-17116-5
This is the forum to discuss the Wrox book Professional DotNetNuke Module Programming by Mitchel Sellers and Shaun Walker - Wrox DotNetNuke Series Editor; ISBN: 978-0-470-17116-5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional DotNetNuke Module Programming ISBN: 978-0-470-17116-5 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 8th, 2009, 03:18 PM
Registered User
 
Join Date: Dec 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Labels etc on ascx page "Not Declared"

Hi,

I am getting the following error when trying to get the Guestbook module working. In the SignGuestbookVb.ascx.vb file, for example, I am getting the following error:

Name 'txtWebsite' is not declared

But the txtWebsite is declared, so I am not sure what is causing this. The only thing I have been able to determine is that the SignGuestbookVB.ascx.designer.vb is no longer associated with its parent, in the DNN project I have the designer is no longer showing up as a child to the Veiwsettings.ascx, rather it is inline with is, somewhat like this:

Code:
<viewsettings.ascx>
      <viewsettings.ascx.vb>
<viewsettings.ascx.designer.vb>
When it should be:

Code:
<viewsettings.ascx>
      <viewsettings.ascx.vb>
      <viewsettings.ascx.designer.vb>
<editGuestBookVB.ascx>
Here is a code snippet from the ViewSettings.ascx defining the txtWebsite:

Code:
            <td>
                <asp:TextBox ID="txtWebsite" runat="server" MaxLength="255" CssClass="NormalTextbox" ValidationGroup="Guestbook" />
And the corresponding ViewSettings.ascx.vb saying where it says txtWebsite is not defined:

Code:
                oInfo.SubmitterWebsite = Server.HtmlEncode(txtWebsite.Text)
Any help would be much appreciated.

Thanks,

Chris
 
Old January 22nd, 2010, 02:30 PM
Authorized User
 
Join Date: Jan 2010
Posts: 29
Thanks: 0
Thanked 1 Time in 1 Post
Default

I had the same problem. In your .ascx file, double check that your first line is like this:

<%@ Control Language="vb" AutoEventWireup="false" Inherits="WroxModules.GuestbookVB.ViewSettings" CodeBehind="ViewSettings.ascx.vb" %>

I originally made this mistake (missing a piece): Inherits="WroxModules.ViewSettings"
 
Old January 22nd, 2010, 04:28 PM
Wrox Author
 
Join Date: Jul 2008
Posts: 74
Thanks: 1
Thanked 8 Times in 8 Posts
Send a message via MSN to msellers
Default

As the above poster mentioned, typically this is due to mis-matched namespaces between the .ascx, .ascx.designer.vb, and the ascx.vb files. Make sure they all match, and you should be set.
__________________
Mitchel Sellers
Microsoft C# MVP, MCITP
Director of Development
IowaComputerGurus Inc.

My blog for .NET and DotNetNuke info

Author of "Professional DotNetNuke Module Programming"

Tech Editor on "Visual Studio 2010 six-in-one" and "Pro C# 4.0"





Similar Threads
Thread Thread Starter Forum Replies Last Post
Difficulties with "web.config" and "ASPNETDB" CFRham BOOK: ASP.NET MVC Website Programming Problem Design Solution ISBN: 9780470410950 2 July 3rd, 2010 10:19 AM
Need code corrections "get sub or function not defined" error" bluesboytoo Excel VBA 1 October 22nd, 2009 11:12 PM
How to theme the "Browse" button of "FileUpload" control? varunbwj BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 2 October 14th, 2009 01:22 AM
Add a CheckBox DataColumn to my DataGridView, Null format: "" or "True" but Error: F ismailc C# 2005 0 September 25th, 2009 04:56 AM
Code not going as planned: "icicle" vs "savedinstancestate" joopthecat BOOK: Professional Android Application Development ISBN: 978-0-470-34471-2 3 May 3rd, 2009 03:09 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.