We are setting the session value to textbox on successful completion of Ajax request.
<table> <tr> <td> Session Value of " Emp Name":</td> <td><asp: Text Box ID="txt Session Value" runat="server"></asp: Text Box></td> </tr> <tr> <td> <asp: Button ID="btn Get Session Value" runat="server" On Client Click="call Ajax Method(event)" Text=" Get Session Value" /> </td> <td> <asp: Button ID="btn Set Session Value" runat="server" On Client Click="call Ajax Method(event)" Text=" Set Session Value" /> </td> </tr> </table> You can use any server side ASP.
But Session is a server side state management technique whose context is restricted to the server side.The following example leads to unpredictable behaviour of the $wppa array elements, some are updated by normal code, some not, it is totally unpredictable what happens. The most strange behaviour is that not all elements of $wppa[xx] show up as $_SESSION['wppa'][xx].If you are using a session variable as a token to use as a handshake on next page load and the token updates on the new page load, but they mysteriously will not match and there is no obvious explanation.The manual on $_SESSION says "An associative array". It does no one any good if this bit of important info about accessing and storing session data remains buried in manual comments.Session variables with a single number will not work, however "1a" will work, as will "a1" and even a just single letter, for example "a" will also work.(Invalid)1st page I wrote a little page for controlling/manipulating the session.I have written an article on how to use Ajax in ASP. Below Get Set Session Value method is used for both setting and getting the session value.