I'm trying to make the following piece of code to work.
Login LoginControl = (Login)PreviousPage.FindControl("Login1");
if (LoginControl != null)
{
TextBox UserName = (TextBox)LoginControl.FindControl("UserName");
if (UserName != null)
{
Label1.Text = UserName.Text;
}
}
else
{
Label1.Text = "Cannot find user name in Login control.";
}
This is an example supplied by the following website:
http://msdn.microsoft.com/en-us/library/ms178139.aspx
However, I don't know how to declare the page Login as a class other pages can use. The actual source code lists Login as a partial class, so I assume there is some property which needs to be set in order to be used as a normal class. Intellisense also is not locating the Login class when I try to use it in a different page.