Iframe URL changing

G

Guest

Dear friends,

I have an IFRAME that I want to change src url when clicking a button.

How can I change IFRAME src using button_click ?

<iframe runat="server" frameBorder=0 marginHeight=0 marginWidth=0
name=login scrolling=no src="https://localhost/default.asp"
width=150 height=97 id=myFrame></iframe>


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs)
myFrame.?????????= "https://localhost/login.asp"
End Sub
 
K

Kody Brown

You can easily do this using Javascript on the client, instead of
server-side.

<iframe runat="server" frameBorder=0 marginHeight=0 marginWidth=0 name=login
scrolling=no src="https://localhost/default.asp" width=150 height=97
id=myFrame></iframe>
<input type="button" value="change url"
onclick="document.getElementById('myFrame').src='new url';"/>

-Kody
 
C

caldera

in the src="https://localhost/default.asp " part change like
src=<%=address%> the code of the page add
public string address in the declarition
and in the page load insert a wanted address you want.
and in the button click change the address value

Is there a way to do this using server-side scripting?
 
G

Guest

Dear Caldera,

It worked fine.

Thanks a lot.

caldera said:
in the src="https://localhost/default.asp " part change like
src=<%=address%> the code of the page add
public string address in the declarition
and in the page load insert a wanted address you want.
and in the button click change the address value

Is there a way to do this using server-side scripting?
 

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