当前位置:编程学习 > C#/ASP.NET >>

网站发布到II7上运行也正常 但是服务器是II6的总是出错

下面这段代码在本地运行正常,网站发布到II7上运行也正常  但是服务器是II6的 
运行是总是报:
未将对象引用设置到对象的实例。System.NullReferenceException: 未将对象引用设置到对象的实例。 在 ActivityView.DataBindInfo(Int32 activityId)

求帮忙看,那里有问题!


 public void DataBindInfo(int activityId)
    {
        SQLServerDAL.ActivityInfo actInfo = new SQLServerDAL.ActivityInfo();
        actInfo = new SQLServerDAL.SqlActivity().GetActivityInfo(activityId);
        if (actInfo != null)
        {
            try
            {

                hyLink.Text = actInfo.ActivityTitle + "(" + Common.ProcessStart.Process((int)actInfo.Process.Value).ToString() + ")";
                actImg.ImageUrl = "Files/" + actInfo.FileImg;
                lblAddress.Text = "活动地址:" + actInfo.ActivitAddress.Split('_')[0];
                lblPeople.Text = "招募人数:" + actInfo.LimitPeople.Value.ToString();
                lblStartTime.Text = "开始时间:" + string.Format("{0:yyyy-MM-dd}", actInfo.StartTime.Value);
                lblTime.Text = "报名时间" + string.Format("{0:yyyy-MM-dd}", actInfo.RegistrationStartTime.Value);
                lblApply.Text = "已报名人数:" + new SQLServerDAL.SqlActivity().CountApply(actInfo.ActivityID).ToString();
                lblLable.Text = "标签:" + new SQLServerDAL.SqlActivity().ActivityLabel(actInfo.ActivityID).ToString();
                txtActivityContent.InnerHtml = actInfo.ActivityContent;
                if (actInfo.Process.Value < 5)
                {
                    txtDiscuss.Value = "暂不能参与评论!";
                    txtDiscuss.Disabled = true;
                    btnDiscuss.Enabled = false;
                }
                int i_iid = 0;
                try
                {
                    Apply.InnerHtml = string.Format("<a href=\"Apply.aspx?activityId={0}\">参加活动</a>", activityId);

                }
                catch (Exception ex)
                {
                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "q", string.Format("console.log({0})", ex.Message + ex), true);

                }
                i_iid = new SQLServerDAL.SqlActivity().ExistAttentionAction(((SQLServerDAL.UsersInfo)Session["Current"]).UserID, actInfo.ActivityID);
                if (i_iid > 0)
                {
                    Action.InnerHtml = "取消关注";
                    Action.Attributes.Add("Actionid", "1");

                }
                else
                {
                    Action.InnerHtml = "添加关注";
                    Action.Attributes.Add("Actionid", "0");
                }
                Action.Attributes.Add("activityid", actInfo.ActivityID.ToString());
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message + ex);
                // Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "q", "alert(" + ex.Message + ");", true);

            }
        }
    }





--------------------编程问答-------------------- 求帮忙看下  很郁闷啊!
补充:.NET技术 ,  .NET Framework
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,