我有一個列表被轉換爲一個數組,然後放入一個會話 ,所以在另一個頁面中我會訪問該數組,但是當我試圖解除它時,它不會返回正確的值將會話變量作爲數組投射到一個會話
//codes from page one :
List<string> seatNum = new List<string>();
string[] seatnumArray = new string[ordered]; //Ordered is a defined int variable
seatnumArray = seatNum.ToArray();
//codes from page two :
if (Session["SeatNum"] != null){
lblseatname.Text = Session["SeatNum"].ToString();
}
//Output view :
System.String[]
'拆箱「不是這種情況下的正確術語。 – Agalo