//前台页面
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebFormTest.aspx.cs" Inherits="WebApplicationUI.TestPage.WebFormTest" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<style type="text/css">
.noticeTitle
{
color: #FFFFFF;
font-size: 14px;
font-family: 黑体;
height: 20px;
}
.noticeContent
{
font-family: 黑体;
font-size: 12px;
color: #60625D;
}
.tableContent
{
font-family: 宋体;
font-size: 14px;
color: #60625D;
text-align: center;
}
fieldset
{
font-size: 12px;
line-height: 140%;
border: shadow(direction=135,color=#92BA3F,strength=1);
color: #585E5C;
width: 100%;
padding: 5px;
}
legend
{
padding: 4px;
color: #92BA3F;
font-size: 18px;
font-family: 方正舒体;
}
.style1
{
width: 80px;
}
.menuBtn{
FILTER: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#FFFFFF, EndColorStr=#B7C985);
border:1pt solid #B7C985;
border-collapse:collapse;
height:25px;
width:80px;
text-align:center;
}
.input
{
width:130px
}
.style2
{
width: 80px;
height: 37px;
}
.style3
{
width: 130px;
height: 37px;
}
.btn_2k3 {
font-family: "tahoma", "宋体";
color: #FFFFFF;
border: 0px solid #93bee2;
cursor: hand;
font-style: normal;
width:60px;
margin-bottom: 0px;
}
</style>
<script type="text/javascript">
function FindPass() {
window.showModalDialog("Pages/FindPassword.aspx", "找回密码", "dialogWidth=450px;dialogHeight=345px;center=yes;resizable=no;help=no;status:no;scroll=no");
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<table cellspacing="0" cellpadding="0" style="width: 1100px;" border="0">
<tr>
<td colspan="5" style="height: 104px;"></td>
</tr>
<tr>
<td colspan="5" style="height: 424px; background-image: url(/HealthWebSite/images/healthlife.png);" valign="top">
<table style="width:100%">
<tr><td style="width:70%"></td>
<td valign="top">
<div id="login" runat="server">
<table style="width:262px; margin-top:0px; border-color:#B7C985; border:1; border-style:solid;" valign="top">
<tr>
<td class="style2" align="center" >用户名</td>
<td class="style3" colspan = "2"><asp:TextBox ID="txtUserName" runat="server" CssClass="input" ></asp:TextBox></td>
</tr>
<tr>
<td class="style1" align="center">密码</td>
<td style="width:100px;" colspan = "2"><asp:TextBox ID="txtPwd" runat="server" TextMode="Password" CssClass="input"></asp:TextBox></td>
</tr>
<tr>
<td class="style1"><asp:Button ID="btnque" CssClass="menuBtn" runat="server" Text="登录" οnclick="btnque_Click" /></td>
<td align = "center"><a href="Pages/Infozhuce1.aspx" class = "menuBtn" target="_blank">用户激活</a></td>
<td align = "center"><a href = "#"onclick = "FindPass()" style = "font-size:9" onmouseover = "this.style.color = 'blue';this.style.text-decoration='underline';">忘记密码?</a></td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td style="height: 30px;">
</td>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td colspan="5">
<table id = "tb_news" runat = "server" style="width:100%">
<tr>
<td style="width: 315px;" valign="top">
<table style="background-image: url(/HealthWebSite/images/notice.gif); background-repeat: no-repeat;height: 20px;width: 100%" cellpadding=0 cellspacing=0>
<tr>
<td class="noticeTitle">
健康活动
</td>
<td class="noticeTitle" style="text-align: center;">
<asp:LinkButton ID="lbtnHealthActivity" runat="server" CssClass="btn_2k3" Text="更多"
οnclick="lbtnMoreInfo_Click" />
</td>
</tr>
</table>
<asp:DataList ID="listHealthActivity" Width="100%" runat="server"
onitemdatabound="listHealthActivity_ItemDataBound">
<HeaderTemplate>
<table style="width: 100%">
</HeaderTemplate>
<ItemTemplate>
<tr>
<td style="font-size: 10px; color: #B7C985; text-align: right; width: 15px; height: 29px;">
●
</td>
<td style="font-family: 黑体; font-size: 14px;cursor: pointer; color: #808080; border-bottom-style: solid; border-bottom-width: 0.5pt;
border-bottom-color: #E2E9D3;">
<a href="/pages/ActitiesShower.aspx?ActivityId=<%# Eval("id") %>" target="_blank">
<%# Eval("TopicOfNotice") %>
<img src ="Images/home_new.gif" id = "img01" runat = "server" alt = "最新消息" style = " border:0px;" />
</a>
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
<tr>
<td style="font-size: 10px; color: #B7C985; text-align: right; width: 15px; height: 29px;">
●
</td>
<td οnclick="recover();" οnmοuseοver="style.color='#008000';" οnmοuseοut="style.color='#808080'"
style="font-family: 黑体; font-size: 14px; cursor: pointer; color: #808080; border-bottom-style: solid;
border-bottom-width: 0.5pt; border-bottom-color: #E2E9D3; font-weight: bold;">
返 回
</td>
</tr>
</table>
</FooterTemplate>
</asp:DataList>
</td>
<td>
</td>
<td style="width: 315px;" valign="top">
<table style="width: 100%;background-image: url(/HealthWebSite/images/notice.gif); background-repeat: no-repeat;
height: 20px;">
<tr >
<td class="noticeTitle">
健康你我他
</td>
<td class="noticeTitle" style="text-align: center;">
<asp:LinkButton ID="lbtnYouAndMe" runat="server" CssClass="btn_2k3" Text="更多" οnclick="lbtnMoreInfo_Click" />
</td>
</tr>
</table>
<asp:DataList ID="listHealthYouAndMe" Width="100%" runat="server"
onitemdatabound="listHealthYouAndMe_ItemDataBound" >
<HeaderTemplate>
<table style="width: 100%">
</HeaderTemplate>
<ItemTemplate>
<tr>
<td style="font-size: 10px; color: #B7C985; text-align: right; width: 15px; height: 29px;">
●
</td>
<td style="font-family: 黑体; font-size: 14px;cursor: pointer; color: #808080; border-bottom-style: solid; border-bottom-width: 0.5pt;
border-bottom-color: #E2E9D3;">
<a href="/pages/ActitiesShower.aspx?ActivityId=<%# Eval("id") %>" target="_blank"><%# Eval("TopicOfNotice") %><img src ="Images/home_new_3.gif" id = "img02" runat = "server" alt = "最新消息" style = " border:0px;" /></a>
</td>
<td></td>
</tr>
</ItemTemplate>
<FooterTemplate>
<tr>
<td style="font-size: 10px; color: #B7C985; text-align: right; width: 15px; height: 29px;">
●
</td>
<td οnclick="recover();" οnmοuseοver="style.color='#008000';" οnmοuseοut="style.color='#808080'"
style="font-family: 黑体; font-size: 14px; cursor: pointer; color: #808080; border-bottom-style: solid;
border-bottom-width: 0.5pt; border-bottom-color: #E2E9D3; font-weight: bold;">
返 回
</td>
</tr>
</table>
</FooterTemplate>
</asp:DataList>
</td>
<td>
</td>
<td style="width: 315px;" valign="top">
<table style="width: 100%;background-image: url(/HealthWebSite/images/notice.gif); background-repeat: no-repeat;
height: 20px;">
<tr >
<td class="noticeTitle">
健康服务
</td>
<td class="noticeTitle" style="text-align: center;">
<asp:LinkButton ID="lbtnHealthService" runat="server" CssClass="btn_2k3" Text="更多" οnclick="lbtnMoreInfo_Click" />
</td>
</tr>
</table>
<asp:DataList ID="listHealthService" Width="100%" runat="server"
onitemdatabound="listHealthService_ItemDataBound">
<HeaderTemplate>
<table style="width: 100%">
</HeaderTemplate>
<ItemTemplate>
<tr>
<td style="font-size: 10px; color: #B7C985; text-align: right; width: 15px; height: 29px;">
●
</td>
<td style="font-family: 黑体; font-size: 14px;cursor: pointer; color: #808080; border-bottom-style: solid; border-bottom-width: 0.5pt;
border-bottom-color: #E2E9D3;">
<a href="/pages/ActitiesShower.aspx?ActivityId=<%# Eval("id") %>" target="_blank"><%# Eval("TopicOfNotice") %><img src ="Images/home_new_1.gif" id = "img03" runat = "server" alt = "最新消息" style = " border:0px;" /></a>
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
<tr>
<td style="font-size: 10px; color: #B7C985; text-align: right; width: 15px; height: 29px;">
●
</td>
<td οnclick="recover();" οnmοuseοver="style.color='#008000';" οnmοuseοut="style.color='#808080'"
style="font-family: 黑体; font-size: 14px; cursor: pointer; color: #808080; border-bottom-style: solid;
border-bottom-width: 0.5pt; border-bottom-color: #E2E9D3; font-weight: bold;">
返 回
</td>
</tr>
</table>
</FooterTemplate>
</asp:DataList>
</td>
</tr>
</table>
<table id = "tb_more_news" visible = "false" runat = "server" style = "width:100%">
<tr style = "height:20;background-image:url(/HealthWebSite/images/center.png)">
<td style = "width:100%">
<table style = "width:100%">
<tr>
<td style = "color:White; font-size:14"><span id = "spanTitle" runat = "server"></span></td>
<td style = "background-image:url(/HealthWebSite/images/center.png); background-repeat:repeat"></td>
<td align = "right"><a href = "#" onclick = "javascript:history.back()" style = "text-decoration:none;color:White" onmouseover = "style.color= 'red'" onmouseout = "style.color= 'White'"><<返回</a></td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<asp:DataList ID = "listMoreInfo" runat = "server" RepeatColumns = "3"
RepeatDirection ="Horizontal" RepeatLayout ="Table" Width = "100%">
<ItemTemplate>
<table style = "border-bottom-style: solid;border-bottom-width: 0.5pt;border-bottom-color: #E2E9D3">
<tr>
<td style="font-size: 10px; color: #B7C985; text-align: right; width: 15px; height: 29px;">●</td>
<td style = "font-size:12px"><a href="/pages/ActitiesShower.aspx?ActivityId=<%# Eval("id") %>" target="_blank"><%# Eval("TopicOfNotice") %></a></td>
</tr>
</table>
</ItemTemplate>
</asp:DataList>
<table style = "font-size:12px">
<tr>
<td colspan = "5"><br /></td>
</tr>
<tr>
<td style = "color:Green">共<font color = "red"><%= ps.PageCount %></font>页<font color = "red" ><%= ps.DataSourceCount %></font>条数据</td>
<td style = "color:Green">当前第<font color= "red"><%= ps.CurrentPageIndex + 1 %></font>页</td>
<td><asp:LinkButton ID = "lnkPrevious" runat = "server" OnClick = "lnk_Click" Font-Size = "10">【上一页】</asp:LinkButton></td>
<td><asp:LinkButton ID = "lnkNext" runat = "server" OnClick = "lnk_Click" Font-Size = "10">【下一页】</asp:LinkButton></td>
<td><asp:LinkButton ID = "lnkEnd" runat = "server" OnClick = "lnk_Click" Font-Size = "10">【末页】</asp:LinkButton></td>
</tr>
<tr><asp:HiddenField ID = "hidMoreNews" runat = "server" Value = "1" /></tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<script type="text/javascript">
document.getElementById("toolBar").style.display = "none";
</script>
</div>
</form>
</body>
</html>
//后台页面(多个linkbutton公用一个事件)
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Common;
using Oledb;
using Platform;
namespace HealthWebSite
{
public partial class Index : System.Web.UI.Page
{
int count = 0;
int count_01 = 0;
int count_02 = 0;
Oledb.ITemplate temp = null;
public PagedDataSource ps = null;
private const string SQL_ACTIVITY = "select top 5 id,TopicOfNotice from Web_Notices where TypeOfNotice='2' order by CreatingDate desc";
private const string SQL_YOU_AND_ME = "select top 5 id,TopicOfNotice from Web_Notices where TypeOfNotice='5' order by CreatingDate desc";
private const string SQL_SERVICE = "select top 5 id,TopicOfNotice from Web_Notices where TypeOfNotice='7' order by CreatingDate desc";
protected void Page_Load(object sender, EventArgs e)
{
temp = DatabaseAccessHandler.GetTemplate(ConnectionName.ClientA);
if (Session["UserInfo"] != null)
{
login.Visible = false;
Master.getGreetingText();
}
else
{
Authenticate();
}
if (!Page.IsPostBack)
{
if (Request.Cookies["userinfo"]!=null)
{
txtUserName.Text = Request.Cookies["userinfo"].Value;
}
BindNoticesInfo();
}
}
private void BindNoticesInfo()
{
listHealthActivity.DataSource = temp.Find(SQL_ACTIVITY);
listHealthActivity.DataBind();
listHealthYouAndMe.DataSource = temp.Find(SQL_YOU_AND_ME);
listHealthYouAndMe.DataBind();
listHealthService.DataSource = temp.Find(SQL_SERVICE);
listHealthService.DataBind();
}
private int[] getDataWithin15Days()
{
string sql_01 = "select count(*) from Web_Notices where DATEDIFF(DD,CreatingDate,GETDATE()) < 15 and typeofnotice = '2'";
string sql_02 = "select count(*) from Web_Notices where DATEDIFF(DD,CreatingDate,GETDATE()) < 15 and typeofnotice = '5'";
string sql_03 = "select count(*) from Web_Notices where DATEDIFF(DD,CreatingDate,GETDATE()) < 15 and typeofnotice = '7'";
int[] array_count = new int[3];
DataSet ds_01 = temp.Find(sql_01);
DataSet ds_02 = temp.Find(sql_02);
DataSet ds_03 = temp.Find(sql_03);
if (ds_01.Tables[0].Rows.Count > 0)
{
array_count[0] = int.Parse(ds_01.Tables[0].Rows[0][0].ToString());
}
else
{
array_count[0] = 0;
}
if (ds_02.Tables[0].Rows.Count > 0)
{
array_count[1] = int.Parse(ds_02.Tables[0].Rows[0][0].ToString());
}
else
{
array_count[1] = 0;
}
if (ds_03.Tables[0].Rows.Count > 0)
{
array_count[2] = int.Parse(ds_03.Tables[0].Rows[0][0].ToString());
}
else
{
array_count[2] = 0;
}
return array_count;
}
/// <summary>
/// 根据传过来的参数验证
/// </summary>
public void Authenticate()
{
string bz = Convert.ToString(Request.QueryString["bz"]);
string str_id_no = Convert.ToString(Request.QueryString["sfz"]);
if ((bz != null) || (str_id_no != null))
{
txtUserName.Text = str_id_no.Trim();
string sql_user_check = string.Format("select LOGIN_PWD FROM WEB_ADDITIONAL_PINFO WHERE IDNumber='{0}'", txtUserName.Text);
DataSet ds = temp.Find(sql_user_check);
if (Convert.ToInt32(bz) == 0)
{
if (ds.Tables.Count != 0 && ds.Tables[0].Rows.Count != 0)
{
txtPwd.Text = ds.Tables[0].Rows[0]["LOGIN_PWD"].ToString();
}
else
{
ClientScript.RegisterClientScriptBlock(GetType(), "OnLoad", "alert('用户名不存在');", true);
}
btnque_Click(null, null);
}
else
{
if (ds.Tables.Count == 0 && ds.Tables[0].Rows.Count == 0)
{
ClientScript.RegisterClientScriptBlock(GetType(), "OnLoad", "alert('身份证不存在');", true);
}
txtUserName.Text = str_id_no.ToString().Trim();
}
}
}
protected void btnque_Click(object sender, EventArgs e)
{
try
{
string ID_NO = txtUserName.Text.ToString().Trim();
string pwd = txtPwd.Text;
if ("".Equals(ID_NO))
{
ClientScript.RegisterClientScriptBlock(GetType(), "OnLoad", "alert('用户名不能为空');", true);
}
else if ("".Equals(pwd))
{
ClientScript.RegisterClientScriptBlock(GetType(), "OnLoad", "alert('密码不能为空');", true);
}
else
{
//string sql = "SELECT BasicInfoID,PatientType,mechanismid,NAME,(select org_name from STATIC_INSTITUTIONS where ID =a.MECHANISMID) OrgName FROM WEB_ADDITIONAL_PINFO a WHERE IDNumber=@ID_NUM AND LOGIN_PWD=@LOGIN_PWD";
string sql = "SELECT BasicInfoID, IDNumber, PatientType,mechanismid,NAME,(select org_name from STATIC_INSTITUTIONS where ID =a.MECHANISMID) OrgName FROM WEB_ADDITIONAL_PINFO a WHERE IDNumber=@ID_NUM AND LOGIN_PWD=@LOGIN_PWD";
DataSet dst = temp.Find(sql, new Oledb.Parameter[] { new Oledb.Parameter("@ID_NUM", ID_NO), new Oledb.Parameter("@LOGIN_PWD", pwd) });
UserInfo info = new UserInfo();//这里实例化一个UserInfo类,得到一个UserInfo对象(实例)
if (dst.Tables.Count != 0 && dst.Tables[0].Rows.Count != 0) //通过验证
{
//根据用户审核状态来判别是否可以登陆
int Typeid = Convert.ToInt32(dst.Tables[0].Rows[0]["PatientType"]);
if (Typeid == 0)
{
//这里就对上面得到的UserInfo对象进行武装
info.Fullname = dst.Tables[0].Rows[0]["NAME"].ToString();
info.IdNumber = ID_NO;
info.Userid = dst.Tables[0].Rows[0]["BasicInfoID"].ToString().ToUpper();
info.Password = pwd;
info.OrgCode = dst.Tables[0].Rows[0]["mechanismid"].ToString().ToUpper();
info.OrgName = dst.Tables[0].Rows[0]["OrgName"].ToString().ToUpper();
//得到当前登录用户的身份证号
info.IdNumber = dst.Tables[0].Rows[0]["IDNumber"].ToString().ToUpper();
Session["UserInfo"] = info;//把得到的UserInfo对象放到Session里面
Response.Cookies["userinfo"].Value = ID_NO;//把当前登录者的用户名放在Cookie里面
Response.Cookies["userinfo"].Expires = DateTime.Now.AddDays(7);//设置Cooki的有效时间是7天
login.Visible = false;
Master.getGreetingText();
}
else
{
ClientScript.RegisterClientScriptBlock(GetType(), "OnLoad", "alert('还未通过审核登陆失败');", true);
}
}
else
{
string sql1 = "select BasicInfoID,PatientType,mechanismid,NAME from WEB_ADDITIONAL_PINFO where nickname=@nickname and LOGIN_PWD=@LOGIN_PWD";
DataSet set = temp.Find(sql1, new Oledb.Parameter[] { new Oledb.Parameter("@ID_NUM", ID_NO), new Oledb.Parameter("@LOGIN_PWD", pwd) });
if (set.Tables.Count != 0 && set.Tables[0].Rows.Count != 0) //通过验证
{
//根据用户审核状态来判别是否可以登陆
int Typeid = Convert.ToInt32(set.Tables[0].Rows[0]["PatientType"]);
if (Typeid == 0)
{
info.Fullname = set.Tables[0].Rows[0]["NAME"].ToString();
info.IdNumber = ID_NO;
info.Userid = set.Tables[0].Rows[0]["BasicInfoID"].ToString().ToUpper();
info.Password = pwd;
info.OrgCode = dst.Tables[0].Rows[0]["mechanismid"].ToString().ToUpper();
Session["UserInfo"] = info;
login.Visible = false;
Master.getGreetingText();
}
else
{
ClientScript.RegisterClientScriptBlock(GetType(), "OnLoad", "alert('还未通过审核登陆失败');", true);
}
}
else
{
ClientScript.RegisterClientScriptBlock(GetType(), "OnLoad", "alert('用户名或密码输入有误');", true);
}
}
}
}
catch (Exception ex)
{
ex.ToString();
}
}
protected void listHealthActivity_ItemDataBound(object sender, DataListItemEventArgs e)
{
if ((e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) && (e.Item.ItemType != ListItemType.Header))
{
count++;
if (count <= getDataWithin15Days()[0])
{
(e.Item.FindControl("img01") as HtmlControl).Visible = true;
}
else
(e.Item.FindControl("img01") as HtmlControl).Visible = false;
}
}
protected void listHealthYouAndMe_ItemDataBound(object sender, DataListItemEventArgs e)
{
if ((e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) && (e.Item.ItemType != ListItemType.Header))
{
count_02++;
if (count_02 <= getDataWithin15Days()[1])
{
(e.Item.FindControl("img02") as HtmlControl).Visible = true;
}
else
(e.Item.FindControl("img02") as HtmlControl).Visible = false;
}
}
protected void listHealthService_ItemDataBound(object sender, DataListItemEventArgs e)
{
if ((e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) && (e.Item.ItemType != ListItemType.Header))
{
count_01++;
if (count_01 <= getDataWithin15Days()[2])
{
(e.Item.FindControl("img03") as HtmlControl).Visible = true;
}
else
(e.Item.FindControl("img03") as HtmlControl).Visible = false;
}
}
//多个linkbutton按钮共同绑定一个事件
protected void lbtnMoreInfo_Click(object sender, EventArgs e)
{
LinkButton objButton = sender as LinkButton;//拿到触发的控件源,前台是多个linkbutton控件共同使用一个响应事件
if (objButton.ID == "lbtnHealthActivity")
{
getPagedDataSource(objButton.ID);//对DataList的数据绑定
tb_news.Visible = false;
tb_more_news.Visible = true;
spanTitle.InnerText = "健康活动";
}
else if (objButton.ID == "lbtnYouAndMe")
{
getPagedDataSource(objButton.ID);//对DataList的数据绑定
tb_news.Visible = false;
tb_more_news.Visible = true;
spanTitle.InnerText = "健康你我他";
}
else
{
getPagedDataSource(objButton.ID);//对DataList的数据绑定
tb_news.Visible = false;
tb_more_news.Visible = true;
spanTitle.InnerText = "健康服务";
}
Session["Notice"] = objButton.ID;
}
/// <summary>
/// 根据选中的更多linkbutton按钮来确定DataList绑定的数据源
/// </summary>
/// <param name="objID"></param>
private void getPagedDataSource(string objID)
{
int currentPage = int.Parse(hidMoreNews.Value) - 1;
ps = new PagedDataSource();
if (objID == "lbtnHealthActivity")
{
ps.DataSource = temp.Find("select id,TopicOfNotice from Web_Notices where TypeOfNotice='2' order by CreatingDate desc").Tables[0].DefaultView;
}
else if (objID == "lbtnYouAndMe")
{
ps.DataSource = temp.Find("select id,TopicOfNotice from Web_Notices where TypeOfNotice='5' order by CreatingDate desc").Tables[0].DefaultView;
}
else
{
ps.DataSource = temp.Find("select id,TopicOfNotice from Web_Notices where TypeOfNotice='7' order by CreatingDate desc").Tables[0].DefaultView;
}
ps.AllowPaging = true;
ps.PageSize = 30;
ps.CurrentPageIndex = currentPage;
Session["endPage"] = ps.PageCount;
listMoreInfo.DataSource = ps;
lnkPrevious.Enabled = true;
lnkNext.Enabled = true;
lnkEnd.Enabled = true;
if (ps.DataSourceCount < ps.PageSize)
{
lnkPrevious.Enabled = false;
lnkNext.Enabled = false;
lnkEnd.Enabled = false;
}
else
{
if (ps.CurrentPageIndex == 0)
{
lnkPrevious.Enabled = false;
}
if (ps.CurrentPageIndex == ps.PageCount - 1)
{
lnkEnd.Enabled = false;
lnkNext.Enabled = false;
}
}
try
{
listMoreInfo.DataBind();
}
catch
{ }
}
protected void lnk_Click(object sender, EventArgs e)
{
LinkButton objButton = sender as LinkButton;
if (objButton.ID == "lnkPrevious")
{
hidMoreNews.Value = (int.Parse(hidMoreNews.Value) - 1).ToString();
getPagedDataSource(Session["Notice"].ToString());
}
else if (objButton.ID == "lnkNext")
{
hidMoreNews.Value = (int.Parse(hidMoreNews.Value) + 1).ToString();
getPagedDataSource(Session["Notice"].ToString());
}
else
{
hidMoreNews.Value = Session["endPage"].ToString();
getPagedDataSource(Session["Notice"].ToString());
}
}
}
}