tags:

views:

596

answers:

3

I know they are bad practice but I have a real need on an internal website for an iframe. I achieved this using the following code behind code on the go button and the iframe html code below.

frame1.Visible = true;
frame1.Attributes["src"] = "http://freckles/bksb_ict/frmDiagnostic.aspx?" + args;

<iframe id="frame1" scrolling="auto" style="position:absolute; top:0; left:0;   height:100%; width:100%;" runat="server" visible="False">
 </iframe>

This worked in visual studio and showed the iframe covering the whole screen as expected but when deployed on iis failed with Server Application Unavailable shown in the iframe.

The reason I set the src dynamically is the initial page is a search, pressing one of the displayed buttons obtains the correct args to send to the iframe.

Any ideas if this can be worked around. I have seen a possible alternative involving an object tag but am unsure if it will end up with the same error.

A: 

Please using relative url for solve invalid application unavailable.

Soul_Master
It's an external page so not a relative link. It does happen to run on the same server.
PeteT
A: 

view source and go to the URL without the frame involved. It could be the args you are passing or the URL you are sending to is broken.

Why don't you put the URL in the frame tag and just add the args instead of hard coding it?

frame1.Attributes["src"] += args
Chad Grant
The args are dynamic, the initial page uses a repeater which obtains the correct args based on which button is pressed.
PeteT
A: 

I solved this in the end, my code actually worked. Turned out when it was deployed there was a mismatch of asp.net versions in the same application pool. It didn't cause a problem until the attempt to display both pages at the same time. Separating them into different application pools fixed it.

PeteT