G
Guest
I have a web page with 2 frames. The left frame is running menu.aspx and the
right frame is running images.aspx. When a selection is made in menu.aspx I
call a method in images.aspx and pass a variable. The intention is that
images.aspx will take the variable and load images into its frame (the right
one) based on the variable passed. What actually happens is the method runs
in the left frame and ruturns the error "Object reference not set to an
instance of a oblect" in the left frame. Nothing happens in the right frame.
The exception is pointing to the line of code located in images.aspx.cs.
How do I make the code in images.aspx.cs affect the frame it is in instead of
the frame it is called from?
Code in menu.aspx.cs:
private void Button1_Click(object sender, System.EventArgs e)
{
string tsource = Startup.MainSource[ListBox1.SelectedIndex].ToString();
string tlongdate = ListBox1.SelectedValue.ToString();
TextBox1.Text = tsource; //local to menu.aspx
Images gi = new Images();
gi.GetImages(tlongdate, tsource);
}
Code in images.aspx.cs:
public void GetImages(string LongDate, string Source)
{
Images mn = new Images();
//this text box is on images.aspx
mn.TextBox1.Text = LongDate; //here is the error
}
Thanks,
Evan R. Hicks
right frame is running images.aspx. When a selection is made in menu.aspx I
call a method in images.aspx and pass a variable. The intention is that
images.aspx will take the variable and load images into its frame (the right
one) based on the variable passed. What actually happens is the method runs
in the left frame and ruturns the error "Object reference not set to an
instance of a oblect" in the left frame. Nothing happens in the right frame.
The exception is pointing to the line of code located in images.aspx.cs.
How do I make the code in images.aspx.cs affect the frame it is in instead of
the frame it is called from?
Code in menu.aspx.cs:
private void Button1_Click(object sender, System.EventArgs e)
{
string tsource = Startup.MainSource[ListBox1.SelectedIndex].ToString();
string tlongdate = ListBox1.SelectedValue.ToString();
TextBox1.Text = tsource; //local to menu.aspx
Images gi = new Images();
gi.GetImages(tlongdate, tsource);
}
Code in images.aspx.cs:
public void GetImages(string LongDate, string Source)
{
Images mn = new Images();
//this text box is on images.aspx
mn.TextBox1.Text = LongDate; //here is the error
}
Thanks,
Evan R. Hicks