日期:2014-05-17  浏览次数:20515 次

使用了Literal空间获取不到值
HTML code
<asp:Literal ID="litId" runat="server" Visible="False"></asp:Literal>

C# code

            T_FuncList tmodel = new T_FuncList();
            tmodel.Id = litId.Text != "" ? Convert.ToInt32(litId.Text) : 0;
            tmodel.FuncName = txtFuncName.Text;
            tmodel.FuncNameEN = txtFuncNameEn.Text;
            tmodel.Url = txtUrl.Text;
            tmodel.Location = txtLocation.Text;
            int result = funll.SetFuncList(tmodel);
            if (result > 0)
            {
                txtFuncName.Text = "";
                txtFuncNameEn.Text = "";
                txtUrl.Text = "";
                txtLocation.Text = "";
            }
            Bind();


------解决方案--------------------
Literal 控件只用来显示的,不能得到值,
要得到值请使用HiddenField控件