Redirect in an Iframe

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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).
 
Back
Top