Iframe

K

Ken Dopierala Jr.

Hi Chris,

Your iFrame is just holding a regular .aspx page. So in the click event of
that button on the server side run your code and then do a
Response.Redirect() to your new page. Good luck! Ken.
 
C

Chris Kennedy

Sorry I'm not understanding you. It is webform containing an iframe I
thought you needed javascript to change an inline frame. I need to change
the iframe from the webform. Could you demonstrate with a little code to
make thing clearer. Cheers.
 
G

Guest

if you need to load the iframe from Code behind

iframe1.Attributes["src"] = strUrl;

To set this from Code behind your iframe need to be runat=server
<iframe runat="server" id="iframe1" >

if you need to load the iframe from Javascript
document.all("iframe1").src = strUrl;

pls let me know incase any questions
 
K

Ken Dopierala Jr.

Hi Chris,

What is in the iFrame? What is the 'src' property equal to? If it is
another .aspx page then when you click a button a postback for that page
will occur like you want. In that button's click even just put:

Response.Redirect("NextPage.aspx")

The iFrame will then display the next page and the other frames won't
change. Remember that when your page in the frame posts back it isn't going
to post back to the webform containing the iFram but to itself. Ken.
 
C

Chris Kennedy

I want to put an Iframe on a webform page. How do I get the Iframe's source
file to change at the press of button control on a web form (containing the
iframe). Preferabaly without javascript, postbacks are acceptable. Cheers.
 
C

Chris Kennedy

I realise that you have to use client side code this creates a problem as I
need to code to execute on the server before the iframe loads.
 

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,777
Messages
2,569,604
Members
45,226
Latest member
KristanTal

Latest Threads

Top