您好,登錄后才能下訂單哦!
前臺頁面:
<div class="mtgz_prev_next">
<p>
<span class="textcolor6">上一篇:</span>
<asp:Label ID="lblPre" runat="server" Text=""></asp:Label>
</p>
<p>
<span class="textcolor6">下一篇: </span>
<asp:Label ID="lblNext" runat="server" Text=""></asp:Label>
</p>
</div>
后臺代碼:
protected void GetPreTitle()
{
if (!string.IsNullOrEmpty(NewsID))
{
int num = Convert.ToInt32(NewsID);
DataSet ds = bll.GetList("ID=" + (num - 1));
if (ds.Tables[0].Rows.Count > 0)
{
newsArr["PreTitle"] = ds.Tables[0].Rows[0]["Title"].ToString();
newsArr["PreID"] = num - 1;
lblPre.Text=" <a href=ljwm-mtgz-ny.aspx?ID=" + newsArr["PreID"].ToString() + ">" + newsArr["PreTitle"].ToString() + "</a>";
}
else
{
lblPre.Text ="已經是第一篇";
}
}
}
protected void GetNextTitle()
{
if (!string.IsNullOrEmpty(NewsID))
{
int num = Convert.ToInt32(NewsID);
DataSet ds = bll.GetList("ID=" + (num + 1));
if (ds.Tables[0].Rows.Count > 0)
{
newsArr["NextTitle"] = ds.Tables[0].Rows[0]["Title"].ToString();
newsArr["NextID"] = num + 1;
lblNext.Text = " <a href=ljwm-mtgz-ny.aspx?ID=" + newsArr["NextID"].ToString() + ">" + newsArr["NextTitle"].ToString() + "</a>";
}
else
{
lblNext.Text ="已經是最后一篇";
}
}
}
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。