UnderSeven
asked on
asp.net calling variable undeclared when is clearly declared
In the following code the varaible 'strVisDiscount','strVisDi sconn','st rVisActive ' are all listed as undeclared, but the above examples 'encString' to 'strBGroup' are not throwing the same error.
Declaration code here:
Why arn't they all being considered declared and how do I fix it?
<input type="hidden" name="session" value="<%=encString %>" />
<input type="hidden" name="billerId" value="<%=strBiller %>" />
<input type="hidden" name="billerGroupId" value="<%=strBGroup %>" />
</td>
</tr>
<tr>
<td align="left">
<b>Billed Services</b>:
<asp:datalist id="ddlConnections" runat="server" Width="100%" cellpadding="4" Visible="true">
<HeaderTemplate>
<td valign="top" width="14%" align="left">
<b>Service</b>
</td>
<td valign="top" width="14%" align="left">
<b>Equipment ID</b>
</td>
<td valign="top" width="14%" align="left">
<b>Rate</b>
</td>
<td valign="top" width="14%" align="left">
<b><%=strVisDiscount%></b>
</td>
<td valign="top" width="14%" align="left">
<b>Connected</b>
</td>
<td valign="top" width="14%" align="left">
<b><%=strVisDisconn %></b>
</td>
<td valign="top" width="14%" align="left">
<b><%=strVisActive %></b>
Declaration code here:
#Region "Private Members"
Private strTemplate As String
Private strConnectionTemplate As String
Private strBillTemplate As String
Public encString As String = ""
Public strBiller As String = ""
Public strBGroup As String = ""
Public strEBillStat As String
Public strVisDiscount As String = "Discount"
Public strVisDisconn As String = "Disconnected"
Public strVisActive As String = "Active"
#End Region
Why arn't they all being considered declared and how do I fix it?
Is it just the editor or is it a compilation error?
try to recompile as sometimes the editor doesn't pickup things instantly...
try to recompile as sometimes the editor doesn't pickup things instantly...
ASKER
I tried loading this ascx file into my default.aspx and got this error:
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Could not load type 'Cogsdale.Modules.ViewCogs dale'.
Source Error:
Line 1: <%@ Control language="vb" Inherits="Cogsdale.Modules .ViewCogsd ale" Codebehind="ViewCogsdale.a scx.vb" AutoEventWireup="false" Explicit="True" %>
Line 2: <%@ Register TagPrefix="dnn" TagName="Audit" Src="~/controls/ModuleAudi tControl.a scx" %>
Line 3: <asp:panel ID="pnlUse" runat="server">
So it's failing to load the code behind file, but I can't see why.
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Could not load type 'Cogsdale.Modules.ViewCogs
Source Error:
Line 1: <%@ Control language="vb" Inherits="Cogsdale.Modules
Line 2: <%@ Register TagPrefix="dnn" TagName="Audit" Src="~/controls/ModuleAudi
Line 3: <asp:panel ID="pnlUse" runat="server">
So it's failing to load the code behind file, but I can't see why.
What type of project is that? Website or WebApplication?
Can we see the code-behind as well please...
Can we see the code-behind as well please...
ASKER
It's a web application. The whole code behind is over 300 lines, here is everything leading up to those definitions:
Imports DotNetNuke
Imports System.Web.UI
Imports System.Collections.Generic
Imports System.Reflection
Namespace Cogsdale.Modules
''' -----------------------------------------------------------------------------
''' <summary>
''' The ViewDynamicModule class displays the content
''' </summary>
''' <remarks>
''' </remarks>
''' <history>
''' </history>
''' -----------------------------------------------------------------------------
Partial Class ViewCogsdale
Inherits Entities.Modules.PortalModuleBase
Implements Entities.Modules.IActionable
#Region "Private Members"
Private strTemplate As String
Private strConnectionTemplate As String
Private strBillTemplate As String
Public encString As String = ""
Public strBiller As String = ""
Public strBGroup As String = ""
Public strEBillStat As String
Public strVisDiscount As String = "Discount"
Public strVisDisconn As String = "Disconnected"
Public strVisActive As String = "Active"
#End Region
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
This solved my problem and another I was having.
Public Shared strVisDiscount As String = "Discount"