0

所以基本上我需要在我的 windows 窗体 c# 应用程序中进行 if(!IsPostBack) 检查,因为在从文本框中获取一个值后,一旦它不再获取该值而是给出 null。但是我得到了错误。错误:

The name IsPostBack does not exist in the current context

我有:

using System.Web.UI;

所以我不确定为什么会这样。任何见解或解决方案将不胜感激,谢谢。

这是我的代码:

        if(!IsPostBack)
            System.Console.WriteLine("Text: " + textBox2.Text);
            MakeSureFieldIsFilledIn errormessagefieldempty = new MakeSureFieldIsFilledIn();
            errormessagefieldempty.ShowDialog();
        }
4

1 回答 1

0

根据您尝试执行的操作,您应该将此代码段移至您的事件处理程序。

于 2015-07-27T15:58:00.100 回答