日期:2014-05-16  浏览次数:20930 次

请教跨线程给服务器控件赋值的问题,急!
protected void Page_Load(object sender, EventArgs e)
        {
atime.Elapsed += new System.Timers.ElapsedEventHandler(timetogo);
                        atime.Interval = 10000;
                        atime.Enabled = true;
        }
 protected void timetogo(object sender, EventArgs e)
        {
            List<Npt.Model.CardOperation> model = new List<Model.CardOperation>();
            model = Bll.GetDriverOperationResult(userid);
            if (model != null)
            {
                for (int i = 0; i < model.Count; i++)
                {
                    if (model[i].Photo != null)
                    {
                        atime.Enabled = false;
                        BindIMG(model[i]);
                    }
                }
            }
        }
 private void BindIMG(Model.CardOperation model)
        {
            string _name = model.OperateTime.ToString("yyMMddHHmmss");
            string url = System.AppDomain.CurrentDomain.BaseDirectory.ToString() + "Photo\\" + _name + ".jpg";