Showing posts with label display. Show all posts
Showing posts with label display. Show all posts

Wednesday, March 28, 2012

view images through xml

I am trying to create a slideshow that has some text and an image. I am able to scroll through the xml file and display the text elements. My problem is with the images. Can anyone help? Thanks

XML:

<?xml version="1.0" encoding="iso-8859-1" ?>
<dogs>
<info>
<name>Archer</name>
<handler>P.O. 1</handler>
<skills>Drugs</skills>
<birthday>4</birthday>
<imagesrc>Images/K9/Dogs/Archer.jpg</imagesrc>
</info>

code:

<xml src="http://pics.10026.com/?src=XML/dogs.xml" id="xmldso" async="false"></xml>

<table width="100%">
<tr>
<td style="width:50%;" align="right">
<span datasrc="#xmldso" datafld="imagesrc"></span>
</td>
<td style="width:50%;" align="left">
<table style="border: activeborder 1px solid">
<tr><td class="TableBottom" width="70">Name:</td><td class="TableBottom" width="100"><span datasrc="#xmldso" datafld="name"></span></td></tr>
<tr><td class="TableBottom" width="70">Handler:</td><td class="TableBottom" width="100"><span datasrc="#xmldso" datafld="handler"></span></td></tr>
<tr><td class="TableBottom" width="70">Skills:</td><td class="TableBottom" width="100"><span datasrc="#xmldso" datafld="skills"></span></td></tr>
<tr><td class="TableBottom" width="70">Birthday:</td><td class="TableBottom" width="100"><span datasrc="#xmldso" datafld="birthday"></span></td></tr>
<tr><td width="70"></td><td width="100"></td></tr>
</table>
</td>
</tr>
<tr>
<td align="center" colspan="2">
<A href="http://links.10026.com/?link=JavaScript:moveprevious()"> Back</A>
|
<A href="http://links.10026.com/?link=JavaScript:movenext()"> Next</A>
</td>
</tr>
<tr>
<td align="center" colspan="2">
<INPUT TYPE="text" WIDTH="100" NAME="Number" style="border:0; text-align:center;">
</td>
</tr>
</table>

<SCRIPT LANGUAGE="JavaScript">

function Start()
{
x=xmldso.recordset;
document.Canine.Number.value=x.absoluteposition+" of "+x.recordcount;
// document.getElementById("mypic").src =x.recordset("imagesrc") ;
}

function movenext()
{
x=xmldso.recordset;

if (x.absoluteposition < x.recordcount)
{x.movenext();}
else if (x.absoluteposition = x.recordcount)
{x.movefirst();}

document.Canine.Number.value=eval(x.absoluteposition);
document.Canine.Number.value=x.absoluteposition+" of "+x.recordcount;
}

function moveprevious()
{
x=xmldso.recordset;

if (x.absoluteposition > 1)
{x.moveprevious();}
else if (x.absoluteposition = 1)
{x.movelast();}

document.Canine.Number.value=eval(x.absoluteposition);
document.Canine.Number.value=x.absoluteposition+" of "+x.recordcount;
}

</SCRIPT>

Change this line <span datasrc="#xmldso" datafld="imagesrc"></span>

to <img datasrc="#xmldso" datafld="imagesrc" />

use the img html control instead of the span control. I tested this in my local machine and works fine

let us know

I tired that and did not work. When I scroll through the images, all I get the the missing image with the red x where the image should be.


Well, it should work. do you have the following image?

Images/K9/Dogs/Archer.jpg

right click the red icon and see the image path.


Yes, I have the image. I even moved it to the same folder as the xml file in case the path was not accurate.


Chris,

I am using IE 7 and it works fine. Which browser and what version are you using?


Forget my last comment. It did work. I did not properly refresh the xml file. Thanks for your help. It is appreciated.

Virtual Earth Question

Has anyone used the new build of Atlas to display the Virtual Earth control? I am unable to make it work. All I get is the copyright message from microsoft and the background image but not the maps

Any help would be great!!

<components>
<virtualEarthMap id="map" latitude="43.644755000"longitude="-79.392211000" zoomLevel="10" />
</components
that works :)

but looking to see if the Dashboard can be displayed:

params.showDashboard = false;
_map = new Msn.VE.MapControl(this.element, params);

Why is the Dashboard default to not show and theres no way of passingin the parameter or changing the JS ourselves since it is packaged intothe DLL now...

What alternatives can we do in using VE Control in Atlas and customizing the properties?

Monday, March 26, 2012

Wait Message...

Can anyone point me in the right direction on constructing a wait message for when an AJAX page is performing an action?

I would like to display a message that is centered on the screen when the user (for example) clicks a button to perform an action. Further, I would like to disable the page (and all controls on it) so that a response is received before continuing.

Thank you,

Jason

You might want to take a look at the UpdateProgressOverlayExtender in http://www40.brinkster.com/rajbk/FlanControls.html.

Take a look at this http://weblogs.asp.net/rajbk/archive/2007/01/08/using-the-updateprogress-control-as-a-modal-overlay.aspx to use it as a modal overlay.

Hope it helps.

German Afanador


You can use <asp:UpdateProgress > Control for that

or there are third parties control that can you use..

http://www.ajaxium.com/ajax-for-asp.net.aspx

Wednesday, March 21, 2012

Web Service Call executes 2 times !

Hello

When I make a call to an asynchronous web service the call is executes 2 times ! Except when I display an alert message before treating the result from the server, it only executes 1 time.

Here is my code on the client side:

functiononComplete(result)
{
var count=result.rows.length;
varcity=$get("<%= txtCity.ClientID %>");

if (count== 1)
city.value=result.rows[0].upName; (upName is the name of the city in the database)
else
{

alert('stop'); ---> WHEN I ADD THE ALERT MESSAGE HERE THE WEB SERVICE IS EXECUTED ONCE
----> WHEN I OMIT THE ALERT MESSAGE IT IS EXECUTES TWICE !

varsel=document.createElement('select');
sel.setAttribute('id', 'ddlCity');
sel.options[0]=newOption('<-- Select your city-->');

for (vari=0;i<result.rows.length;i++)
sel.options[i+1]=newOption(result.rows[i].upName);

document.getElementById('divCity').appendChild(sel);
}
}

Already found where my problem was.

When using my keyboard of my notebook, I have to use the SHIFT key to enter the numbers, and there are always 2 events triggered.

1) releasing the last digit itself to search
2) releasing the SHIFT key

So... problem solved :-)