Working on Asp.Net C # VS08 I would like to assign a value to a session using javascript. Is it possible?
example: Session ["Id"] = document.getElementById ("id"). value;
A session is a server concept; Javascript has no idea about this.
You can create an AJAX service that sets the session value.
However, most likely you should use a cookie. You can set cookies in Javascript using this library , among others.
No, this cannot be done directly with JavaScript on the client side.
. , cookie, , . , , cookie- .
JavaScript XMLHttpRequest ASP.NET, , , . , , , .
, , JavaScript. cookie.
http://www.w3schools.com/js/js_cookies.asp
, , Ajax.
No, It is Immpossible. A session is a server object. A few ways to do this is to send cookies from JavaScript and use them on the server side to assign a value to the session variable or make an AJAX call and set the values on the server.
Source: https://habr.com/ru/post/1729506/More articles:SAP Portal with Third Site - portletNSObjectFromString ... Any way to do this? - stringHow to make Resharper show Refactoring that it is already - visual-studio-2008Saving default argument values in method chain - pythonDatabase Optimization: Hashing All Values - optimizationAsyncFileUpload has a logical error in AjaxControlToolkit when the component is on a different tab, therefore it is not displayed - javascriptRails: редактор на месте, но нет обратной передачи? - javascriptextract single line from HTML using Ruby / Mechanize (and Nokogiri) - ruby | fooobar.comHeapAlloc returns 0xC0000017: insufficient quota - heapСуществует ли схема XSD для оператора SQL Select - sqlAll Articles