How can we access and reference classes and variables in different pages in ASP.NET? In version 2003, it was straight forward, just reference the class name of the page and the whole page becomes at your command, but with Websites instead of Web Applications, that does not seem to be the case. I have an App_Code folder, with a class that has the following string defined:
public string GetPath()
{
return mypage.thisUrl;
}
and another page that looks like this:
public partial class mypage : System.Web.UI.Page
{
public string thisUrl
{
get { return "/newfolder/mypage.aspx"; }
}
protected void Page_Load(object sender, EventArgs e)
{
}
}
but obviously it doesnt work... it would be great if someone can refer me to a good source of knowledge as I tried MSDN, this site, and Google, and I also have a book sitting next to me, finding your way around is not easy :(