HI
I have News Table in my database
Date
|
News
|
NewsTitle
|
Id
|
2013-4-15
|
News1
|
Title1
|
1
|
2013-4-20
|
News2
|
Title2
|
2
|
2013-5-25
|
News3
|
Title3
|
3
|
and I have Datalist in News.aspx page that I bind it from database and in this datalist I define Hyperlink that show NewsTitle column'S data from database and when users click on hyperlink it go to ShowNews.aspx pge and I define 2 image control
asp:DataList ID="DLNews" runat="server" RepeatColumns="1" RepeatDirection="Horizontal" CssClass="DlAE">
<ItemTemplate>
<div>
<asp:HyperLink ID="lblnewsA" runat="server" CssClass="lblAE" NavigateUrl = '<%#"ShowNews.aspx?id="+Eval("id") %>' Target="_blank"><%#Eval("news")%></asp:HyperLink>
<asp:Image ID="Imgclose" runat="server" ImageUrl="~/image/closedEnvelope.png" CssClass="Dimghelp" />
<asp:Image ID="Imgopen" runat="server" ImageUrl="~/image/openEnvelope.png" CssClass="Dimghelp" Visible="flase" />
</div>
</ItemTemplate>
</asp:DataList>
AND SP
ALTER procedure [dbo].[shownewsAES]
as
begin
select top 2 NewsTitle,date,id
from News
order by date desc
end
according above SP it show just 2 row from database
as you see I define 2 image control ClosedEnvelop and OpenEnvelop that visible="false" when users go to their News.aspx page they can see NewsTitle and image=ClosedEnvelop in their page and when they click on newsTitle they can go to shownews.aspx page and see compelete description of news...
Now I want when users go to News.aspx page and see NewsTitle and click on it for first time after that image control with id="ClosedEnvelope visible="false" AND Image control id="OpenEnvelpe visible="true"
I mean I want when users have new News that they didn't click on it, it show CloseEnvelop image and when they click on NewsTitle just one time it show OpenEnvelop Image
BestRegards