473,406 Members | 2,208 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,406 software developers and data experts.

embedding a webpage

I need to change images with the click of a button but I don't want the
entire page to refresh so I thought I should just use an embedded page.
I'm trying to use the <object> tag for this but can't figure out how to
change the page in the code behind.

I tried a javascript like this:
System.Text.StringBuilder sb = new System.Text.StringBuilder();
sb.Append("<script ");
sb.Append("language='javascript'>");
sb.Append("document.Form1.EmbedPic.data=\"MyPage.a spx?image=Image.jpg\";");
sb.Append("</script>");
RegisterStartupScript("PicPreview", sb.ToString());

but the page never changes. Is there something I'm doing wrong or is there a
better way to do this?
Nov 18 '05 #1
5 1376
Have you considered using client-side JavaScript to change the .SRC property
of an Image tag?

--
Thanks,

Eric Lawrence
Program Manager
Assistance and Worldwide Services

This posting is provided "AS IS" with no warranties, and confers no rights.

"Joe Bonavita" <JBonavita_@_caminus.com> wrote in message
news:u3**************@TK2MSFTNGP12.phx.gbl...
I need to change images with the click of a button but I don't want the
entire page to refresh so I thought I should just use an embedded page.
I'm trying to use the <object> tag for this but can't figure out how to
change the page in the code behind.

I tried a javascript like this:
System.Text.StringBuilder sb = new System.Text.StringBuilder();
sb.Append("<script ");
sb.Append("language='javascript'>");
sb.Append("document.Form1.EmbedPic.data=\"MyPage.a spx?image=Image.jpg\";"); sb.Append("</script>");
RegisterStartupScript("PicPreview", sb.ToString());

but the page never changes. Is there something I'm doing wrong or is there a better way to do this?

Nov 18 '05 #2
yes, I tried changing the .SRC property also but the image doesn't change.
Is RegisterStartupScript not the right way to do this?

"Eric Lawrence [MSFT]" <e_********@hotmail.com> wrote in message
news:eY**************@TK2MSFTNGP09.phx.gbl...
Have you considered using client-side JavaScript to change the .SRC property of an Image tag?

--
Thanks,

Eric Lawrence
Program Manager
Assistance and Worldwide Services

This posting is provided "AS IS" with no warranties, and confers no rights.
"Joe Bonavita" <JBonavita_@_caminus.com> wrote in message
news:u3**************@TK2MSFTNGP12.phx.gbl...
I need to change images with the click of a button but I don't want the
entire page to refresh so I thought I should just use an embedded page.
I'm trying to use the <object> tag for this but can't figure out how to
change the page in the code behind.

I tried a javascript like this:
System.Text.StringBuilder sb = new System.Text.StringBuilder();
sb.Append("<script ");
sb.Append("language='javascript'>");

sb.Append("document.Form1.EmbedPic.data=\"MyPage.a spx?image=Image.jpg\";");
sb.Append("</script>");
RegisterStartupScript("PicPreview", sb.ToString());

but the page never changes. Is there something I'm doing wrong or is

there a
better way to do this?


Nov 18 '05 #3
Can you show me what your code looks like?

--
Thanks,

Eric Lawrence
Program Manager
Assistance and Worldwide Services

This posting is provided "AS IS" with no warranties, and confers no rights.

"Joe Bonavita" <JBonavita_@_caminus.com> wrote in message
news:#S**************@TK2MSFTNGP09.phx.gbl...
yes, I tried changing the .SRC property also but the image doesn't change.
Is RegisterStartupScript not the right way to do this?

"Eric Lawrence [MSFT]" <e_********@hotmail.com> wrote in message
news:eY**************@TK2MSFTNGP09.phx.gbl...
Have you considered using client-side JavaScript to change the .SRC

property
of an Image tag?

--
Thanks,

Eric Lawrence
Program Manager
Assistance and Worldwide Services

This posting is provided "AS IS" with no warranties, and confers no

rights.

"Joe Bonavita" <JBonavita_@_caminus.com> wrote in message
news:u3**************@TK2MSFTNGP12.phx.gbl...
I need to change images with the click of a button but I don't want the entire page to refresh so I thought I should just use an embedded page. I'm trying to use the <object> tag for this but can't figure out how to change the page in the code behind.

I tried a javascript like this:
System.Text.StringBuilder sb = new System.Text.StringBuilder();
sb.Append("<script ");
sb.Append("language='javascript'>");

sb.Append("document.Form1.EmbedPic.data=\"MyPage.a spx?image=Image.jpg\";");
sb.Append("</script>");
RegisterStartupScript("PicPreview", sb.ToString());

but the page never changes. Is there something I'm doing wrong or is

there
a
better way to do this?



Nov 18 '05 #4
System.Text.StringBuilder sb = new System.Text.StringBuilder();
sb.Append("<script ");
sb.Append("language='javascript'>");
sb.Append("document.frmHouse.Image1.SRC=\"bluehous e.jpg\";");
sb.Append("</script>");
RegisterStartupScript("PicPreview", sb.ToString());

This is being called from an ImageButton click event.

NOTE: the image is going to be differnent each time the button is clicked.

"Eric Lawrence [MSFT]" <e_********@hotmail.com> wrote in message
news:Ol****************@TK2MSFTNGP09.phx.gbl...
Can you show me what your code looks like?

--
Thanks,

Eric Lawrence
Program Manager
Assistance and Worldwide Services

This posting is provided "AS IS" with no warranties, and confers no rights.
"Joe Bonavita" <JBonavita_@_caminus.com> wrote in message
news:#S**************@TK2MSFTNGP09.phx.gbl...
yes, I tried changing the .SRC property also but the image doesn't change.
Is RegisterStartupScript not the right way to do this?

"Eric Lawrence [MSFT]" <e_********@hotmail.com> wrote in message
news:eY**************@TK2MSFTNGP09.phx.gbl...
Have you considered using client-side JavaScript to change the .SRC

property
of an Image tag?

--
Thanks,

Eric Lawrence
Program Manager
Assistance and Worldwide Services

This posting is provided "AS IS" with no warranties, and confers no

rights.

"Joe Bonavita" <JBonavita_@_caminus.com> wrote in message
news:u3**************@TK2MSFTNGP12.phx.gbl...
> I need to change images with the click of a button but I don't want

the > entire page to refresh so I thought I should just use an embedded page. > I'm trying to use the <object> tag for this but can't figure out how to > change the page in the code behind.
>
> I tried a javascript like this:
> System.Text.StringBuilder sb = new System.Text.StringBuilder();
> sb.Append("<script ");
> sb.Append("language='javascript'>");
>

sb.Append("document.Form1.EmbedPic.data=\"MyPage.a spx?image=Image.jpg\";");
> sb.Append("</script>");
> RegisterStartupScript("PicPreview", sb.ToString());
>
> but the page never changes. Is there something I'm doing wrong or is

there
a
> better way to do this?
>
>



Nov 18 '05 #5
Can you send me the content of resultant the HTML page? I'd expect the
RegisterStartupScript call to put something in the Body OnLoad, so I'm not
sure how the button click fits into things. In classic HTML, you'd simply
add an OnClick event to the button tag that performed the .SRC change. In
ASP.NET, you'd want to have RUNAT=client, I'd expect...
"Joe Bonavita" <JBonavita_@_caminus.com> wrote in message
news:uo**************@TK2MSFTNGP09.phx.gbl...
System.Text.StringBuilder sb = new System.Text.StringBuilder();
sb.Append("<script ");
sb.Append("language='javascript'>");
sb.Append("document.frmHouse.Image1.SRC=\"bluehous e.jpg\";");
sb.Append("</script>");
RegisterStartupScript("PicPreview", sb.ToString());

This is being called from an ImageButton click event.

NOTE: the image is going to be differnent each time the button is clicked.

"Eric Lawrence [MSFT]" <e_********@hotmail.com> wrote in message
news:Ol****************@TK2MSFTNGP09.phx.gbl...
Can you show me what your code looks like?

--
Thanks,

Eric Lawrence
Program Manager
Assistance and Worldwide Services

This posting is provided "AS IS" with no warranties, and confers no

rights.

"Joe Bonavita" <JBonavita_@_caminus.com> wrote in message
news:#S**************@TK2MSFTNGP09.phx.gbl...
yes, I tried changing the .SRC property also but the image doesn't change. Is RegisterStartupScript not the right way to do this?

"Eric Lawrence [MSFT]" <e_********@hotmail.com> wrote in message
news:eY**************@TK2MSFTNGP09.phx.gbl...
> Have you considered using client-side JavaScript to change the .SRC
property
> of an Image tag?
>
> --
> Thanks,
>
> Eric Lawrence
> Program Manager
> Assistance and Worldwide Services
>
> This posting is provided "AS IS" with no warranties, and confers no
rights.
>
> "Joe Bonavita" <JBonavita_@_caminus.com> wrote in message
> news:u3**************@TK2MSFTNGP12.phx.gbl...
> > I need to change images with the click of a button but I don't want
the
> > entire page to refresh so I thought I should just use an embedded

page.
> > I'm trying to use the <object> tag for this but can't figure out
how to
> > change the page in the code behind.
> >
> > I tried a javascript like this:
> > System.Text.StringBuilder sb = new System.Text.StringBuilder();
> > sb.Append("<script ");
> > sb.Append("language='javascript'>");
> >
>

sb.Append("document.Form1.EmbedPic.data=\"MyPage.a spx?image=Image.jpg\";"); > > sb.Append("</script>");
> > RegisterStartupScript("PicPreview", sb.ToString());
> >
> > but the page never changes. Is there something I'm doing wrong or is there
> a
> > better way to do this?
> >
> >
>
>



Nov 18 '05 #6

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

Similar topics

3
by: Phil Frost | last post by:
Greetings all. I'm attempting to embed a python interpreter at a very low level in an OS I am writing. Currently I'm stuck with build issues. Firstly, as there is no working C compiler in our OS, I...
4
by: Alicia Haumann | last post by:
I accidentally sent this to webmaster@python.org, so this could be a duplicate if "webmaster" forwards it to this list. :{ Hi, there. Thanks for any help that can be offered. I've been...
11
by: Anna | last post by:
Hi all. I want to embed the EMBED tag in the object tag. I understood that I need to provide a PARAM tag inside the OBJECT whose value will hold the content of EMBED src attribute, but after...
56
by: alan b | last post by:
I copied it and tried to edit the movie.htm below in the <PARAM NAME=*** location of the file where the videoclip is on my hard drive. It is already recorded by Windows Media Player. My version...
8
by: Alan Lue | last post by:
Hi, I'm trying to set up a webpage so that I can view multiple HTML files from the same page. For example, you might go to http://example.com/lab_tests.html and be able to view lab1.html,...
3
by: Gérard Talbot | last post by:
Hello all, When webfonts are used for purely cosmetic/ornemental reasons and on a large scale, I don't agree. When webfonts are used because Unicode support among browsers for a particular...
4
by: markoueis | last post by:
Is there any way to embed a ClickOnce Application into the browser? I love the way ClickOnce works, but the problem is I would like it to display the windows form in the browser. I could use a...
0
by: hq4000 | last post by:
Given AStyleSheet.xsl : <AStyleSheet> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.mytest.mytest2.mytest3.com" version="1.0"> <xsl:output method="xml"...
7
by: atlkhan | last post by:
I have a flash movie I want to include it in the webpage. How this can be done.
14
by: ginugopinath | last post by:
I am doing a project on social n/w website,one of the features being webcasting.Now for webcasting there is a need for an encoder s/w(say Real Producer Basic),I have this .exe downloaded. Now I need...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.