Is there any way to assign session value using javascript
i can retrive the value from session but assigning is not working
var TempSession = \'<%
Actually there this a tutorial on MSDN that covers you case. It is described in Exposing Web Services to Client Script, see "Calling Static Methods in an ASP.NET Web Page" section.
All you have to do is to set EnablePageMethods property to True on your ScriptManager control, then using PageMethods object call static method (it should be decorated with WebMethod attribute) declared in code behind.