i am using datalist to show notification. 5 notification save in database but only one notification show.
pls check this is my code
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<br />
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Panel ID="pnlntfc" runat="server" Width="100%" Height="200px">
<asp:DataList ID="DataList1" runat="server" Width="500px"
onitemdatabound="DataList1_ItemDataBound1">
<ItemTemplate>
<table style="width:100%">
<tr>
<td colspan="2">
<asp:Label ID="lblnfication" runat="server" Text="Notifications"
Font-Names="Times New Roman" ForeColor="Black" Font-Size="Larger"
Height="30px"></asp:Label>
</td>
</tr>
<tr>
<td>
<asp:Button ID="btnall" runat="server" Text="ALL" CssClass="button" />
</td>
<td>
<asp:Button ID="BTNUNREAD" runat="server" Text="Unread" CssClass="button" />
</td>
</tr>
<tr>
<td>
<asp:Image ID="imagephoto" runat="server" ImageUrl='<%#Eval("imagedata") %>' CssClass="imag" />
</td>
<td>
<asp:Label ID="pblmutname" runat="server" Text='<%#Eval("msg") %>'></asp:Label>
</td>
</tr>
<tr>
<td colspan="2">
<asp:Label ID="PostedOnLabel" runat="server"
Text='<%# Eval("Date_time") %>'
ToolTip='<%# Eval("Date_time") %>' />
</td>
</tr>
</table>
</ItemTemplate>
</asp:DataList>
</asp:Panel>
<asp:Timer ID="Timer1" runat="server" Interval="6000" ontick="Timer1_Tick">
</asp:Timer>
</ContentTemplate>
</asp:UpdatePanel>
<asp:Label ID="LBLMSG" runat="server" Visible="false"></asp:Label>
</asp:Content>
public partial class USER_Notification : System.Web.UI.Page
{
bal.Find_Friend SR = new bal.Find_Friend();
Int32 id;
protected void Page_Load(object sender, EventArgs e)
{
if (Page.IsPostBack == false)
{
LBLMSG.Visible = false;
SHOWNTFCTION();
}
}
private void SHOWNTFCTION()
{
DataSet odt;
try
{
odt = SR.Shownotification(Int32.Parse(Session["uid"].ToString()));
if (odt != null)
{
if (odt.Tables[0].Rows.Count > 0)
{
DataList1.Visible = true;
DataList1.DataSource = odt;
DataList1.DataBind();
}
else
{
DataList1.Visible = false;
LBLMSG.Visible = true;
LBLMSG.Text = "No Latest Notification Found";
}
}
else
{
LBLMSG.Visible = true;
LBLMSG.Text = "No Latest Notification Found";
}
}
catch (Exception ex)
{
LBLMSG.Visible = true;
LBLMSG.Text = ex.Message;
}
}
protected void Timer1_Tick(object sender, EventArgs e)
{
pnlntfc.Visible = true;
SHOWNTFCTION();
}
}