In javascript, I can access LocalStorage
ex:
localStorage.setItem(“lastname”, “Smith”);
can I set and read from localstorage in wiseJ?
Thanks,
Shawn
You can also use Application.Browser.LocalStorage, SessionStorage and CookieStorage.
Thanks Jens.
I will try …
Best Regards
Marcelo Blank
Hi Marcelo,
here is the LocalStorage example working with Wisej 2.
I had to delete the Window1.resx and let it re-create from VS. It got a compiler error some, which said there are “web restrictions” on this file.
I also set the Build Action of the JS-file to Embedded Resource and activate the line
[assembly: Wisej.Core.WisejResources(ExcludeList: "")]
in AssemblyInfo.cs.
After these steps the example is now working.
Best,
Jens
Hi Luca
I just get this example above (in WiseJ 1.5) and create it in WiseJ 2 … copying the JS and Component …
I got an initialize error… (Inspector/console).
Could you help me.
Follow a project.
Regards,
Marcelo Blank
See attached local storage sample with component.
See attached local storage sample with component.
You can using javascript. We don’t pass the local storage back to the server since it could be quite large. You can execute any js method directly using Application.Eval().
My suggestion is to add your javascript functions in .js file(s) part of your project and use the methods from the app. You can create either global js functions or create a js object with your functions, like a namespace. Your javascript code can also call back your application on the server using [WebMethod], including methods in Program.cs or on a top level page or window.
I noticed that Application doesn’t have the Call method to be able to automatically serialize parameters, will add.
Please login first to submit.