我正在尝试将会话添加到我网站中的标签,然后将保存在标签中的数字保存回数据库。会话称为customerID
。
我一直在尝试通过这样做来调用会话
int vv = (int)Session["customerID"]
Label7.Text = vv;
//I know this doesn't work but can't work out what I need to make the label display the variable.
然后我试图像这样将它保存回数据库
newCarsRow.CustomerID = Convert.ToInt32(Label7.Text.Trim());
我的问题是如何让标签显示保存的 intcustomerID