hello again,
sorry about another post but im new to OOP and i am having trouble understanding how i can access a variable from one class from a different class.
I have a class
Code:
public class Main : System.Web.UI.Page
{
public string loadFile = " ";
.
.
public void Page_Load(object sender, System.EventArgs e)
{
loadFile = "test";
}
then in my messsage class i have
Code:
public class Message : System.Web.UI.Page
{
Private void Page_Load(object sender, System.EventArgs e)
{
Main mc = new Main();
StreamReader sr = new StreamReader(mc.loadFile);
.
.
}
i have access to the variable "loadFile" but it doesnt seem to grab the text out of the string. OOP is starting to frustrate me >.<
Thanks again guys