如何检索存储在会话中的值数组

如何检索存储在会话中的值数组

本文介绍了如何检索存储在会话中的值数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


在我的视图页面中,我使用
在本地会话中放置了一个数组sessionStorage.setItem("list",array)

并使用ajax将这个数组从视图传递到控制器作为我的操作方法的参数.
如何在控制器中检索这些值的数组


In my view page i put an array in the local session using
sessionStorage.setItem("list",array)

and using the ajax i am passing this array from view to the controller as a parameter to my action method.
how to retrieve these array of values in the controller

推荐答案

string [] arr = Session["list"] as string[];


或者因为您正在使用自定义的本地和全局会话,您也可以尝试以下操作:


Or because you are using custom local and global session you can try with this also:

string [] arr = session.getItem["list"] as string[];




祝一切顺利.
--Amit




All the best.
--Amit


这篇关于如何检索存储在会话中的值数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 22:55