我送我的poolid在hdnfield當我將它給我的錯誤未處理。 poolid是int32
數據類型System.FormatException是由用戶代碼
if (ddlStaticPoolName.Visible)
{
objUserEntity.POOLNAME = Convert.ToString(ddlStaticPoolName.SelectedItem.Text);
objUserEntity.POOlID = Convert.ToInt32(ddlStaticPoolName.SelectedValue);
}
else if (lblDynamicPoolName.Visible)
{
objUserEntity.POOLNAME = Convert.ToString(lblDynamicPoolName.Text);
objUserEntity.POOlID =Convert.ToInt32(hdnDynamicPoolID.Value);
}
else
{
objUserEntity.POOLNAME = "";
objUserEntity.POOlID = 0;
}
你可以顯示你想要轉換爲int32的字符串'ddlStaticPoolName.SelectedValue'的例子嗎? –
哪一行給出錯誤,在if或else-if中,請指出 –
是SelectedValue空字符串? –