468,110 Members | 1,522 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,110 developers. It's quick & easy.

Frame for Response.Driect or Server.Transfer

This is driving me mad so any help will be much appreciated.

I have an html page with 3 frames, banner, left and right. The banner frames
source is an aspx page. The aspx page has two buttons, both need to run some
code and then redirect the user somewhere else. The problem is the redirected
page is being displayed in the banner frame. How do I tell either
Response.Redirect or Server.Transfer what frame to display the page in or
that the redirected page isn’t to be displayed in any of the frames?

Thanks for any help.
Chris.
Nov 19 '05 #1
2 2030
Chris,

The source of your problem here is that IFRAMES aren't really a feature of
Server Side ASP.Net Code. Basically, if the result of your server side code
(which i assume is in an iframe) needs to directly affect the iframes of the
parent page, then you need to pass an indication back to the client side,
indicating that you wish to alter the pages displayed in your iframes.

The way i do it is as follows; I run the server side code, and then place a
value in an ASP.Net text box which has a style tag "DISPLAY:None" (so that
the end user doesn't see it).

In javascript, Create a client-side window.onload event. In the
window.onload event, I check to see if the textbox contains a value using
code similar to the following:

if(Form1.txtTextBox.value.length > 0){
//redirect banner left to other page
window.parent.frames(1).location.href = "otherpage.aspx";
//redirect banner right to other page
window.parent.frames(2).location.href = "anotherpage.aspx";
}

Basically, you need to give your aspx page some server-side indication of
what it is meant to be doing; eg, Telling it that it needs to redirect other
frames to other pages.

Hope this is of help to you.

m00nm0nkey !!!

"Chris Podmore" wrote:
This is driving me mad so any help will be much appreciated.

I have an html page with 3 frames, banner, left and right. The banner frames
source is an aspx page. The aspx page has two buttons, both need to run some
code and then redirect the user somewhere else. The problem is the redirected
page is being displayed in the banner frame. How do I tell either
Response.Redirect or Server.Transfer what frame to display the page in or
that the redirected page isn’t to be displayed in any of the frames?

Thanks for any help.
Chris.

Nov 19 '05 #2
Thanks for the reply.
I had a feeling I was going to have to use some java script which I was
hopeing to aviod as I don't know it. I'll give your sample a try.

It feels like MS missed something out to me. I don't know may be its just me.

"m00nm0nkey" wrote:
Chris,

The source of your problem here is that IFRAMES aren't really a feature of
Server Side ASP.Net Code. Basically, if the result of your server side code
(which i assume is in an iframe) needs to directly affect the iframes of the
parent page, then you need to pass an indication back to the client side,
indicating that you wish to alter the pages displayed in your iframes.

The way i do it is as follows; I run the server side code, and then place a
value in an ASP.Net text box which has a style tag "DISPLAY:None" (so that
the end user doesn't see it).

In javascript, Create a client-side window.onload event. In the
window.onload event, I check to see if the textbox contains a value using
code similar to the following:

if(Form1.txtTextBox.value.length > 0){
//redirect banner left to other page
window.parent.frames(1).location.href = "otherpage.aspx";
//redirect banner right to other page
window.parent.frames(2).location.href = "anotherpage.aspx";
}

Basically, you need to give your aspx page some server-side indication of
what it is meant to be doing; eg, Telling it that it needs to redirect other
frames to other pages.

Hope this is of help to you.

m00nm0nkey !!!

"Chris Podmore" wrote:
This is driving me mad so any help will be much appreciated.

I have an html page with 3 frames, banner, left and right. The banner frames
source is an aspx page. The aspx page has two buttons, both need to run some
code and then redirect the user somewhere else. The problem is the redirected
page is being displayed in the banner frame. How do I tell either
Response.Redirect or Server.Transfer what frame to display the page in or
that the redirected page isn’t to be displayed in any of the frames?

Thanks for any help.
Chris.

Nov 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Justin | last post: by
5 posts views Thread by Paul de Goede | last post: by
4 posts views Thread by Harsh Thakur | last post: by
42 posts views Thread by smerf | last post: by
3 posts views Thread by jasonheath.net | last post: by
1 post views Thread by Solo | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.