/// <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; } }
/// <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); // 跳转首页 } }