这是一个页面的静态方法,我想给它传递参数进去,可是不管是session还是request都不行,是还需要引用别的命名空间吗?还是有别的解决方法?
Code
<script type="text/C#" runat="server">
[System.Web.Script.Services.ScriptMethod()]
[System.Web.Services.WebMethod()]
public static AjaxControlToolkit.Slide[] getImg()
{
List<picture> pics;
dataAccess ds = new dataAccess();
pics = ds.selectPicturesByAlbumId(int albumid);
Slide[] imgs=new Slide[pics.Count];
for (int i = 0; i < pics.Count;i++ )
{
picture p = (picture)pics[i];
imgs[i] = new Slide(p.url,p.name,p.description);
}
return imgs;
}
</script>