Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to transfer dat from left subframe to right frame

Status
Not open for further replies.

tathagat

Programmer
Jan 29, 2002
5
US
Hi,
I have this special case. Where the whole page id divided into to vertical frames by first (1) and second (1-2) frmaes. First frame (1) also has a subframe (horizontal frame). Hence it's nested frames for left frame (please see below). Both frame (1-1) and (1-2) are ASPX pages, only frame (1) is HTML page. What I want is how to transfer data from Frame (1-1) to frame (1-2) and make frame (1-2) refresh automatically. Like search button in frame (1-1) pupulates the data from database in frame (1-2) based on the text field in frame (1-1).
I have tried this but it populates the frame (1-2) in to left frames only.
url ="RightFrame.ASPX";
string frameScript = "<script language='javascript'>" +
"window.parent.frames(1).location='" + url + "';</script>";
Page.RegisterStartupScript("FrameScript", frameScript);

1. I use window.parent.frames(0).location - shows at frame (1)
2. I use window.parent.frames(1).location - shows at frame (1-1)
3. 1. I use window.parent.frames(2).location -nothing happens.
Please help me.
Thanks,
Tathagat

-----------------------------------------------------------
First Frame (1) |
--------------------
| Second Frame (1-2)
Second Frame (1-1)
|
|
|
|
|



 
ok this is more of a HTML/JS type question, and might benefit you to post it in one of the other forums, but i will take my wild stab at it.

first of all, no matter how many frames you have the page layout broken into, they can co-exist and interact as long as you have each uniquely named and used in target values for links and forms.

if you're wanting to use JS for this the same applies, you're just using JS to interact between them.

the factor of ASPX vs HTML is not an issue at the moment, it's basic frame interaction.

you noted you have a vertical line split, primary frame 1 and 2
then you have frame 1 split with a horizontal line into sub frame 1 and 2 making 1-1 and 1-2, in essence you've broken a square into halfs, then quarters, while leaving the second half in tact. in other words, you have frame1=navigation, frame2=content (kind of like Tek-Tips here, except in frames)

granted, JS wont be too happy with naming conventions of 1-1 and 1-2 but HTML targets are fine with it. using the number/dash naming, you can reference the whole 1 frame and 2 frame respectively, and if they exist, sub frames 1-1 and 1-2.

so in the example, 1-1 contains a form with a search box.
1-2 shows the results, and frame2(content) is irrelevant at this point, so we'll ignore it.
you'll have in the body of lets call it 1-1.aspx in frame 1-1 with :
Code:
<form method="post" action="1-2.aspx" target="1-2">
blah blah etc
</form>

1-2.aspx is just a plain old aspx page that needs no additional changes cause it's just to display.

NOW... if you need to refer what you click in 1-2.aspx to frame2 or any of it's sub frames you'll need to reference it accordingly in the target attrib.. example:
Code:
<a href="whaterver.aspx" target="2-1">click me</a>

hopefully that helps.



[thumbsup2]DreX
aKa - Robert
if all else fails, light it on fire and do the happy dance!
" I always think outside the 'box', because I'm never inside the 'loop' " - DreX 2005
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top