0

I am developing a silverlight application using the ESRI Gis map. I have it setup to when I move a marker around, it changes the Longitude,Latitude of the marker and I update a label. I am using this code:

        HtmlElement eleLbl = doc.GetElementById("lblGISLocation");
        if (eleLbl != null)
        {
            eleLbl.SetAttribute("innerHTML", latlng.X.ToString() + "," + latlng.Y.ToString());
        }

This works fine on a PC in all browsers. This is the result I get from Firefox on a PC:

<span id="lblGISLocation">-122.304918344379,47.3867897587541</span>

But the same code running on a Mac using either Firefox, Safari or Chrome gives this result:

<span innerhtml="-122.288384409929,47.3832784255738" id="lblGISLocation">0,0</span>

Any Ideas on how I can make this work in either machine?

1 Answer 1

0

Try using the SetProperty method of the HtmlElement:

HtmlElement eleLbl = doc.GetElementById("lblGISLocation");
if (eleLbl != null)
{
    eleLbl.SetProperty("innerHTML", latlng.X.ToString() + "," + latlng.Y.ToString());
}
2
  • There is no InnerHTML property or method on an HtmlElement object. Nov 24, 2013 at 19:11
  • @BitcoSoftware you are right... I was confused with another kind of HtmlElement. I edited my answer.
    – Alberto
    Nov 24, 2013 at 19:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.