0
我需要分配int值隱藏filed.But失敗指定int值隱藏字段
這裏去我的代碼
ASP.NET
<asp:HiddenField ID="hdnCId" runat="server" />
C#
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
int Id= 0;
if (Request.QueryString["Id"] != "" && Request.QueryString["Id"] != null)
{
ChurchId = Convert.ToInt32(Request.QueryString["Id"]);
}
else
{
Id = -1;
}
hdnCId.Value =Id;
}
}