display image

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to write codes in VB.net to display 3 images in series on a
Webform with each image being displayed in the same box for 5 seconds.
I am trying to use Timer and image button, don't know how to get around it.
thanks for any help
 
Simple example:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
<style type="text/css">
</style>

<SCRIPT language="JavaScript">
<!--

var img1 = null;
var img2 = null;
var img3 = null;

if (document.images)
{
img1 = new Image();
img1.src="img/1.jpg";

img2= new Image();
img2.src="img/2.jpg";

img3= new Image();
img3.src="img/3.jpg";
}

var index = 0;

setTimeout('ChangeImage()', 5000);

function ChangeImage()
{
index = (++index % 3) + 1;
document.images["imgPicture"].src = eval('img' + index.toString() +
'.src');
setTimeout('ChangeImage()', 5000);
}
//-->
</SCRIPT>

</head>
<body>
<form id="form1" runat="server">
<img id="imgPicture" name="imgPicture" src="img/1.jpg"/>
<input type=button value="Show" name="btnShow"
onclick="ChangeImage()"/>
</form>
</body>
</html>
 
I forgot to remove the button :D
--
Milosz Skalecki
MCP, MCAD


Milosz Skalecki said:
Simple example:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
<style type="text/css">
</style>

<SCRIPT language="JavaScript">
<!--

var img1 = null;
var img2 = null;
var img3 = null;

if (document.images)
{
img1 = new Image();
img1.src="img/1.jpg";

img2= new Image();
img2.src="img/2.jpg";

img3= new Image();
img3.src="img/3.jpg";
}

var index = 0;

setTimeout('ChangeImage()', 5000);

function ChangeImage()
{
index = (++index % 3) + 1;
document.images["imgPicture"].src = eval('img' + index.toString() +
'.src');
setTimeout('ChangeImage()', 5000);
}
//-->
</SCRIPT>

</head>
<body>
<form id="form1" runat="server">
<img id="imgPicture" name="imgPicture" src="img/1.jpg"/>
<input type=button value="Show" name="btnShow"
onclick="ChangeImage()"/>
</form>
</body>
</html>


--
Milosz Skalecki
MCP, MCAD


Ben said:
I am trying to write codes in VB.net to display 3 images in series on a
Webform with each image being displayed in the same box for 5 seconds.
I am trying to use Timer and image button, don't know how to get around it.
thanks for any help
 
I need to do it in VB.NET codes

Milosz Skalecki said:
Simple example:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
<style type="text/css">
</style>

<SCRIPT language="JavaScript">
<!--

var img1 = null;
var img2 = null;
var img3 = null;

if (document.images)
{
img1 = new Image();
img1.src="img/1.jpg";

img2= new Image();
img2.src="img/2.jpg";

img3= new Image();
img3.src="img/3.jpg";
}

var index = 0;

setTimeout('ChangeImage()', 5000);

function ChangeImage()
{
index = (++index % 3) + 1;
document.images["imgPicture"].src = eval('img' + index.toString() +
'.src');
setTimeout('ChangeImage()', 5000);
}
//-->
</SCRIPT>

</head>
<body>
<form id="form1" runat="server">
<img id="imgPicture" name="imgPicture" src="img/1.jpg"/>
<input type=button value="Show" name="btnShow"
onclick="ChangeImage()"/>
</form>
</body>
</html>


--
Milosz Skalecki
MCP, MCAD


Ben said:
I am trying to write codes in VB.net to display 3 images in series on a
Webform with each image being displayed in the same box for 5 seconds.
I am trying to use Timer and image button, don't know how to get around it.
thanks for any help
 
You wanted to display three images in a web browser (webform) for 5 secs in
the loop, right? There are several approaches
1. javascript as show in my reply
2. Macromedia Flash, Java applet, etc.
3. Javascript + vb.net. javascript -> post back form to server every 5
seconds, vb.net change image
4. ActiveX + <OBJECT> tag
5. VB.NET User Control Library + <OBJECT> tag
--
Milosz Skalecki
MCP, MCAD


Ben said:
I need to do it in VB.NET codes

Milosz Skalecki said:
Simple example:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
<style type="text/css">
</style>

<SCRIPT language="JavaScript">
<!--

var img1 = null;
var img2 = null;
var img3 = null;

if (document.images)
{
img1 = new Image();
img1.src="img/1.jpg";

img2= new Image();
img2.src="img/2.jpg";

img3= new Image();
img3.src="img/3.jpg";
}

var index = 0;

setTimeout('ChangeImage()', 5000);

function ChangeImage()
{
index = (++index % 3) + 1;
document.images["imgPicture"].src = eval('img' + index.toString() +
'.src');
setTimeout('ChangeImage()', 5000);
}
//-->
</SCRIPT>

</head>
<body>
<form id="form1" runat="server">
<img id="imgPicture" name="imgPicture" src="img/1.jpg"/>
<input type=button value="Show" name="btnShow"
onclick="ChangeImage()"/>
</form>
</body>
</html>


--
Milosz Skalecki
MCP, MCAD


Ben said:
I am trying to write codes in VB.net to display 3 images in series on a
Webform with each image being displayed in the same box for 5 seconds.
I am trying to use Timer and image button, don't know how to get around it.
thanks for any help
 
thanks for reply,
is there any documentation on how to do it with option 5(VB.NET)?


Milosz Skalecki said:
You wanted to display three images in a web browser (webform) for 5 secs in
the loop, right? There are several approaches
1. javascript as show in my reply
2. Macromedia Flash, Java applet, etc.
3. Javascript + vb.net. javascript -> post back form to server every 5
seconds, vb.net change image
4. ActiveX + <OBJECT> tag
5. VB.NET User Control Library + <OBJECT> tag
--
Milosz Skalecki
MCP, MCAD


Ben said:
I need to do it in VB.NET codes

Milosz Skalecki said:
Simple example:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
<style type="text/css">
</style>

<SCRIPT language="JavaScript">
<!--

var img1 = null;
var img2 = null;
var img3 = null;

if (document.images)
{
img1 = new Image();
img1.src="img/1.jpg";

img2= new Image();
img2.src="img/2.jpg";

img3= new Image();
img3.src="img/3.jpg";
}

var index = 0;

setTimeout('ChangeImage()', 5000);

function ChangeImage()
{
index = (++index % 3) + 1;
document.images["imgPicture"].src = eval('img' + index.toString() +
'.src');
setTimeout('ChangeImage()', 5000);
}
//-->
</SCRIPT>

</head>
<body>
<form id="form1" runat="server">
<img id="imgPicture" name="imgPicture" src="img/1.jpg"/>
<input type=button value="Show" name="btnShow"
onclick="ChangeImage()"/>
</form>
</body>
</html>


--
Milosz Skalecki
MCP, MCAD


:

I am trying to write codes in VB.net to display 3 images in series on a
Webform with each image being displayed in the same box for 5 seconds.
I am trying to use Timer and image button, don't know how to get around it.
thanks for any help
 
http://aspnet.4guysfromrolla.com/articles/052604-1.aspx
--
Milosz Skalecki
MCP, MCAD


Ben said:
thanks for reply,
is there any documentation on how to do it with option 5(VB.NET)?


Milosz Skalecki said:
You wanted to display three images in a web browser (webform) for 5 secs in
the loop, right? There are several approaches
1. javascript as show in my reply
2. Macromedia Flash, Java applet, etc.
3. Javascript + vb.net. javascript -> post back form to server every 5
seconds, vb.net change image
4. ActiveX + <OBJECT> tag
5. VB.NET User Control Library + <OBJECT> tag
--
Milosz Skalecki
MCP, MCAD


Ben said:
I need to do it in VB.NET codes

:

Simple example:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
<style type="text/css">
</style>

<SCRIPT language="JavaScript">
<!--

var img1 = null;
var img2 = null;
var img3 = null;

if (document.images)
{
img1 = new Image();
img1.src="img/1.jpg";

img2= new Image();
img2.src="img/2.jpg";

img3= new Image();
img3.src="img/3.jpg";
}

var index = 0;

setTimeout('ChangeImage()', 5000);

function ChangeImage()
{
index = (++index % 3) + 1;
document.images["imgPicture"].src = eval('img' + index.toString() +
'.src');
setTimeout('ChangeImage()', 5000);
}
//-->
</SCRIPT>

</head>
<body>
<form id="form1" runat="server">
<img id="imgPicture" name="imgPicture" src="img/1.jpg"/>
<input type=button value="Show" name="btnShow"
onclick="ChangeImage()"/>
</form>
</body>
</html>


--
Milosz Skalecki
MCP, MCAD


:

I am trying to write codes in VB.net to display 3 images in series on a
Webform with each image being displayed in the same box for 5 seconds.
I am trying to use Timer and image button, don't know how to get around it.
thanks for any help
 
Back
Top