ASP.NET Convert to Web App question
- by mattgcon
The following web control will not convert for some reason (add designer and cs pages). I am getting a page directive is missing error What is wrong with the code that is causing it to not convert?
<%@ Control Language="C#" AutoEventWireup="true" %>
<%@ Register TagPrefix="ipam" TagName="tnavbar" src="~/controls/tnavbar.ascx" %>
<script language="C#" runat="server">
string strCurrent = "";
string strDepth = "";
public string Current
{
get { return strCurrent; }
set { strCurrent = value; }
}
public string Depth
{
get { return strDepth; }
set { strDepth = value; }
}
void Page_Load(Object sender, EventArgs e) {
idTnavbar.Current = strCurrent;
idTnavbar.Item1Link = strDepth + idTnavbar.Item1Link;
idTnavbar.Item2Link = strDepth + idTnavbar.Item2Link;
idTnavbar.Item3Link = strDepth + idTnavbar.Item3Link;
idTnavbar.Item4Link = strDepth + idTnavbar.Item4Link;
idTnavbar.Item5Link = strDepth + idTnavbar.Item5Link;
idTnavbar.Item6Link = strDepth + idTnavbar.Item6Link;
idTnavbar.Item7Link = strDepth + idTnavbar.Item7Link;
}
</script>
<ipam:tnavbar id="idTnavbar"
Item1="2000 -- 2001"
Item1Link="2000_--_2001.aspx"
Item2="2001 -- 2002"
Item2Link="2001_--_2002.aspx"
Item3="2002 -- 2003"
Item3Link="2002_--_2003.aspx"
Item4="2003 -- 2004"
Item4Link="2003_--_2004.aspx"
Item5="2004 -- 2005"
Item5Link="2004_--_2005.aspx"
Item6="2005 -- 2006"
Item6Link="2005_--_2006.aspx"
Item7="2006 -- 2007"
Item7Link="2006_--_2007.aspx"
runat="server" />
Please help, if I can solve this issue many more pages will be fixed to.