How to set javascript data in asp session variable?

Posted by fazilmir on Stack Overflow See other posts from Stack Overflow or by fazilmir
Published on 2013-10-21T09:50:44Z Indexed on 2013/10/21 9:53 UTC
Read the original article Hit count: 131

i am having a div and i am adding innerHtml in it using javascript. now what i want is that i have to set that innerHtml data in my session variable. and want to use that session variable in my another asp webform page. but i dont know how to perform this task.

any help will be highly appreciated.

i am doing it like this.

//cartDetailsDiv is a div in which i am adding innerHtml through javascript.

//now i am getting that innerHTML in my session variable like this

Session["_cartDetails"] = cartDetailsDiv.InnerHtml.ToString();

Response.Write(Session["_cartDetails"].ToString());

but i am getting nothing in my session variable.

please help me out.

© Stack Overflow or respective owner

Related posts about c#

Related posts about JavaScript