You're on the right track.
You can output a bit of client side javascript to do the trick.
RegisterStartupScript functions to do this.
/library/en-us/cpref/html/frlrfSystemWebUIPageClassRegisterClientScriptBlockTopic.asp
/library/en-us/cpref/html/frlrfSystemWebUIPageClassRegisterClientScriptBlockTopic
Steve C. Orr, MCSD, MVP
"Evan" <Evan@discussions.microsoft.com> wrote in message
news:0FEDF5A3-C552-427F-8AC1-C56B48D3D5F6@microsoft.com...
> That answers my question about my current behavior. The problem is that I
> am
> converting an existing site to .NET and it uses two asp pages in separate
> frames. Is there a way that a button click on menu.aspx can load
> images.aspx
> in another frame? I can pass the data on the url line for the
> communication
> between the pages. I was thinking maybe Response.Redirect but there is no
> option for a target frame.
>
> Thanks,
> Evan
>
> "Steve C. Orr [MVP, MCSD]" wrote:
>
>> You must understand that menu.aspx and images.aspx do not exist on the
>> server at the same instance in time, therefore they cannot communicate
>> directly with each other.
>> Instead you need to use other techniques, such as client side code and/or
>> Session state to pass data between the pages.
>> This is one reason I try to avoid frames with ASP.NET; it's usually too
>> complex to be worth it.
>> Instead it's generally a better idea to use User Controls to divide up
>> logical sections of your pages.
>>
>> Here's more info:
>>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbconintroductiontowebusercontrols.asp
>>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vboriwebusercontrols.asp
>>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbconWebUserControlsVsCustomWebControls.asp
>>
>> --
>> I hope this helps,
>> Steve C. Orr, MCSD, MVP
>>
http://Steve.Orr.net >>
>>
>> "Evan" <Evan@discussions.microsoft.com> wrote in message
>> news:0F743AA3-B87A-4B51-9FD8-36DCB3F8F00A@microsoft.com...
>> >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
>>
>>
>>