如何在asp.net中检查字符串值并刷新页面

时间:2015-07-13 16:27:41

标签: asp.net backgroundworker global-asax

我在静态类中有一个静态字符串,它从桌面应用程序中获取值,

在asp.net上的

我必须检查它的null或有值,如果它有值,我想

在标签上显示(在aspx页面上),我将一个背景工作者放在global.asax中,

public static BackgroundWorker worker = new BackgroundWorker();
        public static int ID = 0;
      //  public static List<Person> personList = new List<Person>();
        public static string personList;
        public static bool stopWorker = false;
        void Application_Start(object sender, EventArgs e)
        {
            worker.DoWork += new DoWorkEventHandler(DoWork);
            worker.WorkerReportsProgress = true;
            worker.WorkerSupportsCancellation = true;
            worker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(WorkerCompleted);
            // Calling the DoWork Method Asynchronously
            worker.RunWorkerAsync();



    private static void DoWork(object sender, DoWorkEventArgs e)
    {
        //foreach (Person p in personList)
        //{
        personList = Class1.GetDataFromDesktop;
        //}
    }

它的检查值不时,但我无法在aspx页面上的标签上显示响应 ,该怎么做,是否有任何其他过程或我可以使用global.asax

0 个答案:

没有答案