ASP.NET 4.0 隐藏字段
HiddenField hidCurrentFooterLinks = (HiddenField)gvTaxonomy.FindControl("hidCurrentFooterLinks");
hidCurrentFooterLinks.Value = txtFooterLinkCurrentYear.Text;
HiddenField hidPreviousFooterLinks = (HiddenField)gvTaxonomy.FindControl("hidPreviousFooterLinks");
hidPreviousFooterLinks.Value = txtFooterLinkPreviousYear.Text;
txtFooterLinkCurrentYear.Text = "";
txtFooterLinkPreviousYear.Text = "";
这是我的代码。我收到类似对象引用未设置到对象实例
之类的异常。 请帮我。
HiddenField hidCurrentFooterLinks = (HiddenField)gvTaxonomy.FindControl("hidCurrentFooterLinks");
hidCurrentFooterLinks.Value = txtFooterLinkCurrentYear.Text;
HiddenField hidPreviousFooterLinks = (HiddenField)gvTaxonomy.FindControl("hidPreviousFooterLinks");
hidPreviousFooterLinks.Value = txtFooterLinkPreviousYear.Text;
txtFooterLinkCurrentYear.Text = "";
txtFooterLinkPreviousYear.Text = "";
This is my code. I am getting Exception like Object reference not set to an instance of an object
.
Please help me.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最有可能的是您的控件尚未找到,您需要确保找到该控件并且未返回空引用。
Most likely it is the your controls have not been found, you need to make sure the control is found and a null reference not returned.