473,396 Members | 1,779 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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 2225
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: \A_Michigan_User\ | last post by:
Ok, I give up... why do 1-4 work fine... but 5-6 give "can't find" errors? 1. Client-side VBscript code: call navigate("\\209.11.22.33\MyDir") 2. Client-side VBscript code: location.href...
3
by: Justin | last post by:
Hi, Im confused here over the usage of Response.Redirect and Server.Transfer. I used frameset for my work, what are the proper usages of the two methods that seems working similar.. The...
5
by: Paul de Goede | last post by:
I set the Response.Filter in my aspnet application but I have noticed that if you do a Server.Transfer that the filter doesn't get called. And in actual fact the response is mostly empty. It seems...
4
by: Harsh Thakur | last post by:
Hi, I'd like to know the performance related differences between Response.Redirect and Server.Transfer. I'd like to redirect the user to a different page. I can either do a...
3
by: qwerty | last post by:
I´m new to ASP.Net. My workmate has some experience with it. He claimed that in ASP.Net working with frames is much simpler than it was ASP. I asked explanation but he couldn't give me such. (a...
3
by: Alan Silver | last post by:
Hello, Sorry if this is a stupid question, but I can't really see much difference between these tow methods according to the scant info in the SDK. Could anyone enlighten me? TIA -- Alan...
42
by: smerf | last post by:
Using javascript, is there a way to trap an external page inside a frame? I've seen scripts to break out of frames, but nothing to keep a page trapped in a frame.
9
by: RN1 | last post by:
When a server encounters the line Response.Redirect("abcd.asp") in a ASP script, the server tells the browser that it has to be redirected to another page (which is abcd.asp, in this case)....
3
by: jasonheath.net | last post by:
I apologize in advance for the length of this post. I wanted to get as much detail as possible in here. We have 1 web app that contains the functionality to do some single sign-on logic. The...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.