Redirect in an Iframe

G

Guest

Aspx-problem :
I want to write code (C-sharp) behind a button, that determines on some criteria which webpage an IFRAME has to show.

To change a normal webpage you do a redirect in c-scharp (response.redirect "page1.aspx).
But in a webpage I have an IFRAME and I want only to change the contents of that IFRAME.

In a previous question Cliff proposed the following
on the static part:
<a href="newIframepage.aspx?par1=something" target="myIFrame">Click me to
change the Iframe</a>

then on the varialbe part:
<iframe name="myIFrame" (other attributes I'm sure go here) >
That was good, but I want to do it from my c-sharp code (because I need to do some test)
Thanks,
JAc
 
A

adnan boz

Hi,
You can change it from an aspx tag. like below:
<IFRAME src="<%= myURL %>" .....
You have to declare the public myURL variable within your cs code.
And change it on your button click event.

Another solution could be with RegisterClientScriptBlock,
where you have to send client-side javascript to navigate your IFRAME.

Good Luck
Adnan



Jac said:
Aspx-problem :
I want to write code (C-sharp) behind a button, that determines on some
criteria which webpage an IFRAME has to show.
To change a normal webpage you do a redirect in c-scharp
(response.redirect "page1.aspx).
 

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

Top