ASP.NET Error when referencing a code-behind variable
- by mattgcon
I have an aspx page that is supposed to reference a code-behind variable but I am receiving an error of "The name [variable] does not exist in the current context"
Here is the aspx code
<%@ Control Language="C#" AutoEventWireup="true" Inherits="IPAM.Website.Controls.controls_event_header" Codebehind="event_header.ascx.cs" %>
<%# strEventLink %>
<h3><%# strEventDate %></h3>
<%# strLinks %>
Here is part of the aspx.cs code declaring those variables:
public string strEventLink = "";
public string strEventDate;
public string strLinks = "";
Here is the part of the aspx.cs code where it sets those variables:
strEventLink = "<h2>" + parent.Name + "</h2>";
strLinks += "<p><font size=\"+1\"><a href=\"" + Page.ResolveUrl("~" + strScheduleLink) + "\"><b>" + strScheduleLinkText + "</b></a></font></p>\n";
strEventDate = ei.DateSpan;
Please help me with this problem