server.transfer to reload PARENT page (contains frames) -- how to retain values?

K

KathyB

Hi,

Been reading a LOT about frames, variables, etc. I realize you can NOT
use server.transfer with target frames (which are client)...

I have a Parent frame containing Left and Right frames. IS IT POSSIBLE
(and HOW please) to do the following:

4 text controls filled in by user in Left frame, with a button click
event to:

Reload Parent frame containing: reload Left frame keeping (or
replacing) its .text values and load a new Right frame, loading an
xmlDocument (source filename is needed from a text value in Left
frame).

Any EXAMPLES very appreciated...or can I simply NOT do this?

Thanks, Kathy

p.s. I know there is a lot of opinion AGAINST frames, but that is not
an option for me just now...thanks.
 
A

Axel Dahmen

You might want to use dynamically created client script in your left frame to reload the whole window after postback. You can build a query string on postback to forward to the other frames.

HTH,
Axel Dahmen
 
A

Axel Dahmen

There are many ways to do that. One would be to add the "onload" event to the left frame's body tag:

HtmlGenericControl bodyCtrl;

void Page_Load()
{
...

if (IsPostBack)
{
...

string query="";

query+="var1="+HttpUtility.URLEncode(myTxtBox1.Text);
query+="&var2="+HttpUtility.URLEncode(myTxtBox2.Text);
query+="&var3="+HttpUtility.URLEncode(myTxtBox3.Text);
query+="&var4="+HttpUtility.URLEncode(myTxtBox4.Text);

bodyCtrl.Attributes.Add("onload","top.location='OuterFrame.aspx?"+query+"'")
}

...
}

The body element of your left frame must of course have a RunAt="Server" attribute:

<body Runat="Server" id="bodyCtrl">


In your outer frame file then, you forward the query string to the right frame... I guess you know how to create hyperlinks (or any text) dynamically?

HTH,
Axel Dahmen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top