Unable to set the value of in Javascript


  • Hi All,

     Am programatically creating Path in JavaScript using createFromXAml and then i add the path dynamically using mousemove

    For this i set the Data attribute using a var path that contains the Silverlight PAth

    var pathData = //path String created by me

     path["Data"] = pathData;

     This does not seem to work and it throws an error.

     How to set the value of Path's Data attribute dynamically/Programatically From Javscript

    Thursday, July 30, 2009 2:36 AM


All replies

  • The basic idea seems to work for me. Two areas that could be your trouble spots, but can't really tell you more without seeing your code.

    It's tricky to get a reference to any part that comes from CreateFromXaml due to namescope issues. Do you know for sure that you've got a reference to your Path?

    Path strings are tricky in and of themselves. It's really more of a design output format by intention. I'm not sure I'd be trying to crank them out on the fly unless you have a library that already does that for you.

    Friday, July 31, 2009 8:55 PM
  • Hi,

    You can try to refer this thread:, Which talks how to  set one element's value dynamically by Javascript?

    hope it helps.

    Wednesday, August 05, 2009 5:22 AM