输入字符串格式不正确
protected void Button1_Click(object sender, EventArgs e)
{
Components.Model.P_Price price = new Components.Model.P_Price();
int ss = Convert.ToInt32(hf.Value);//错误:输入字符串格式不正确
price.Tid = 36;
price.Price = int.Parse(TextBox1.Text.Trim());
price.UpTime = DateTime.Now;
price.Tids = ss;
BLL.P_Price bll = new BLL.P_Price();
bll.Add(price);
}
hf.value是<asp:HiddenField ID="hf" runat="server" />控件接收的js文件里函数的返回值
不加TextBox控件的时候是可以输出值的,加上TextBox控件hf.Value就为空了,
为什么啊?