Hi
How can I set the wallpaper on the desktop in code/AjaxMetod
e.g something like this:
Kind regardsCode:[AjaxMethod]
public void SaveSettings()
{
this.MyDesktop.Wallpaper = this.cbWallpaper.SelectedItem.Value;
}
Steen
Printable View
Hi
How can I set the wallpaper on the desktop in code/AjaxMetod
e.g something like this:
Kind regardsCode:[AjaxMethod]
public void SaveSettings()
{
this.MyDesktop.Wallpaper = this.cbWallpaper.SelectedItem.Value;
}
Steen
Hi,
We added support to change Wallpaper during AjaxEvent.
Till new release you can use next code:
MyDesktop.AddScript("{0}.getDesktop().setWallpaper ({1});",*MyDesktop.ClientID, url);*
Thanks for the reply, but I seem to miss something as this just gives an JavaScript error:
JavaScript error is: 'images' is not definedCode:[AjaxMethod]
public void SaveSettings()
{
mwSettings settings = new mwSettings();
MyDesktop.AddScript("{0}.getDesktop().setWallpaper({1});", MyDesktop.ClientID, "images/wallpaper/img16.jpg");
}
Hi,
you should add quoutes or JSON.Serialize
[AjaxMethod]
public void SaveSettings()
{
*** mwSettings settings = new mwSettings();
*** MyDesktop.AddScript("{0}.getDesktop().setWallpaper ('{1}');", MyDesktop.ClientID, "images/wallpaper/img16.jpg");*
****
}*
or
[AjaxMethod]
public void SaveSettings()
{
*** mwSettings settings = new mwSettings();
*** MyDesktop.AddScript("{0}.getDesktop().setWallpaper ({1});", MyDesktop.ClientID, JSON.Serialize("images/wallpaper/img16.jpg"));*
****
}
Sorry, my mistake... I just copied your code without thinking :)
Now it works, thanks !