change src

Jun 12, 2008 at 4:55 PM
Hi,
Is it possible to change src after page load like :  

$("#left").src = "left2.htm";

Thanks..
Best regards
Sep 25, 2008 at 9:34 AM
Edited Sep 25, 2008 at 9:37 AM
Hi,I too am facing the same problem, i tried setting the src value like this <script language="javascript" type="text/javascript">  function SetDivSrcValue(arg) { var d = document.getElementById("div1") ; if (d != null) d.src = arg; } </script> but the div simply doesnt load, should i call some sort of reload method as well??? It works fine if the src is specified during design time
Oct 24, 2008 at 3:32 PM
You can get handle of an UFrame object by

var uframe = UFrameManager.getUFrame( id )

Then you can call uframe.navigate( url) to take the uframe to some url.
Nov 24, 2009 at 10:58 AM
Edited Nov 24, 2009 at 11:01 AM

Hi,

So i was trying to dynamicly change the "src" of the Uframe in asp.net.
The above code kept giving me an error where it couldnt find the Uframe.

What i did was solved this problem in the CodeBehind like so:

protected void Page_Load(object sender, EventArgs e)
{
    UFrame1.Load += new EventHandler(UFrame1_Load);
}


protected void UFrame1_Load(object sender, EventArgs e)
{
    UFrame1.Attributes.Remove("src");
    UFrame1.Attributes.Add("src", "Default3.aspx");
}

Ofc this just a small sample, to really dynamicly load the pages just replace the "Default3.aspx" with a string containing the Url that need to be loaded.
So i hope this helps people who also had a problem getting the above script to work. (or maybe its just my lack of javascript knowledge that failed)

Greetz

Nov 24, 2009 at 5:02 PM
Hi,
Sorry but, UFrame is not belong to me. I didn't develop such a component.
I play with Conv2Ajax.,
Have a nice time.
Yusuf Akyol

From: [email removed]
Sent: Tuesday, November 24, 2009 12:58 PM
To: [email removed]
Subject: Re: change src [UFrame:29549]

From: VizualG

Hi,

So i was trying to dynamicly change the "src" of the Uframe in asp.net.
The above code kept giving me an error where it couldnt find the Uframe.

What i did was solved this problem in the CodeBehind like so:

<font size="2" color="#0000ff"><font size="2" color="#0000ff">

protected

</font></font><font size="2" color="#0000ff">

</font>

void Page_Load(object sender, EventArgs e)
{
UFrame1.Load += new EventHandler(UFrame1_Load);
}

<font size="2" color="#0000ff"><font size="2" color="#0000ff">

protected

</font></font><font size="2" color="#0000ff">

</font>

void UFrame1_Load(object sender, EventArgs e)
{
UFrame1.Attributes.Remove("src");
UFrame1.Attributes.Add("src", "Default3.aspx");
}

Ofc this just a small sample, to really dynamicly load the pages just replace the "Default3.aspx" with a string containing the Url that need to be loaded.
So i hope this helps people who also had a problem getting the above script to work. (or maybe its just my lack of javascript knowledge that failed)

Greetz