Ejemplo n.º 1
0
        /// <summary>
        /// 显示用户发布的动态
        /// </summary>
        protected void DisplayCurrentList()
        {
            try
            {
                Int64 userId = GetUserId();

                if (userId == -1)
                {
                    Response.Redirect("/layout/SignIn.aspx");
                    return;
                }

                DataTable data = CurrentService.GetCurrentByUserId(userId);

                if (data != null)
                {
                    ListCurrent.DataSource = data;
                    ListCurrent.DataBind();
                }
            }
            catch (Exception ex)
            {
                PromptInfo.Text = ex.Message;
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 根据话题 ID 展示动态
        /// </summary>
        protected void DisplayCurrentOfTopic()
        {
            try
            {
                DataTable data = GetDataOfCurrrent();

                if (data != null)
                {
                    ListCurrent.DataSource = data;
                    ListCurrent.DataBind();
                }
            }
            catch (Exception ex)
            {
                PromptInfo.Text = ex.Message;

                Response.Redirect(URL_HOME); // 跳转首页
            }
        }