- Create Xml File—Counter.Xml
- <?xml version="1.0" standalone="yes"?>
- <counter>
- <count>
- <hits>0<hits>
- <count>
- <counter>
On page load
this.countMe();
DataSet ds = new DataSet();
ds.ReadXml(Server.MapPath("counter.xml"));
lblcounter.Text = ds.Tables[0].Rows[0]["hits"].ToString().Trim();
Lblcounter is the id of the label which is defined in the .aspx Page.
<asp:Label ID="lblcounter" runat="server" Text="Label" BackColor="#CCFF99"
ondatabinding="Page_Load" BorderColor="Maroon"></asp:Label>
No comments:
Post a Comment