473,320 Members | 1,922 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Iframe URL changing

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

Nov 18 '05 #1
4 8718
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='n ew url';"/>

-Kody

"Robson Carvalho Machado" <Ro*******************@discussions.microsoft.com >
wrote in message news:24**********************************@microsof t.com...
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

Nov 18 '05 #2
Is there a way to do this using server-side scripting?

"Kody Brown" wrote:
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='n ew url';"/>

-Kody

"Robson Carvalho Machado" <Ro*******************@discussions.microsoft.com >
wrote in message news:24**********************************@microsof t.com...
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


Nov 18 '05 #3
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

"Robson Carvalho Machado" <Ro*******************@discussions.microsoft.com > wrote in message news:10**********************************@microsof t.com...
Is there a way to do this using server-side scripting?

"Kody Brown" wrote:
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='n ew url';"/>

-Kody

"Robson Carvalho Machado" <Ro*******************@discussions.microsoft.com >
wrote in message news:24**********************************@microsof t.com...
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



Nov 18 '05 #4
Dear Caldera,

It worked fine.

Thanks a lot.

"caldera" wrote:
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

"Robson Carvalho Machado" <Ro*******************@discussions.microsoft.com > wrote in message news:10**********************************@microsof t.com...
Is there a way to do this using server-side scripting?

"Kody Brown" wrote:
> 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='n ew url';"/>
>
> -Kody
>
> "Robson Carvalho Machado" <Ro*******************@discussions.microsoft.com >
> wrote in message news:24**********************************@microsof t.com...
> > 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
> >

>
>
>

Nov 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Jim Marquardson | last post by:
Hi, I've struggled with this for a while now, so I'm asking for help. I am trying to click on a link in one page, have that link open up in a new window, and set that newly opened window's...
3
by: coolsti | last post by:
I need some help here. I am making an application which allows a user to look at a series of picture files one at a time, and enter the outcome of various visual tests to a database. The...
4
by: seans | last post by:
Hi, Is there some way from preventing the JavaScript code in a document loaded into an iframe from executing? I don't have access to the pages being loaded into the i-frame so I can't modify...
4
by: Jaco | last post by:
Hey, Maybe I am in the wrong newsgroup. I am writing an browserapplication. In the webpage I have 2 parts a fixed part and a variable part. The variable part is an IFRAME. If I press a button in...
3
by: Angel | last post by:
How do I get the reference of the IFrame from the asp.net webpage that is being displayed within that IFrame? In other words I have an IFrame in my page. Within that IFrame Set the source to a...
3
by: David Virgil Hobbs | last post by:
I discovered how to write out the inner HTML of the contents of an Iframe; I want to know how to write out the outerHTML of the contents of an Iframe. frames.document.body.innerHTML allows me to...
3
by: bulldog8 | last post by:
I am having problems with changing a frames source file for Mozilla (1.5.0.4). The followig code works for IE: <script type="text/javascript"> var imgP = new Image(); function...
6
by: howa | last post by:
Since it is part fo the standard, why I always heard that we should avoid iframe? any comments? thanks.
4
by: raymon | last post by:
Hi, I have a page with two iframes that load content from another website. Only one of the iframes is shown at a time, depending on which tab the user is viewing. If user clicks on tab A, he will...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.