aadimalli Posted February 14, 2007 Share Posted February 14, 2007 Please tell me the code how to retrieve no of visits for the page Link to comment Share on other sites More sharing options...
aspnetguy Posted February 14, 2007 Share Posted February 14, 2007 you need to install a counter on your page. there are lots of free ones our you can make your own. Link to comment Share on other sites More sharing options...
jesh Posted February 14, 2007 Share Posted February 14, 2007 If you decide to build your own, an easy way to implement this in .NET is to handle it in the Application_BeginRequest event handler in the Global.asax.cs (or Global.asax.vb if you're using VB) file. using System.Web;public class Global : HttpApplication{ protected void Application_BeginRequest(Object sender, EventArgs e) { // This method runs as soon as a request is sent to the web server for // any resource in your .NET website. You can get the path to the file here. string path = HttpContext.Current.Request.Url.AbsolutePath; // "path" will now store the file name for your page. This is where // you could put the code to increment a counter that keeps track of // how many times the page has been loaded. This data could be // stored in a database or in a file on the server's hard drive. // Once all the code in here executes, the request gets sent on its // merry way. }} Link to comment Share on other sites More sharing options...
pulpfiction Posted February 14, 2007 Share Posted February 14, 2007 Please tell me the code how to retrieve no of visits for the pageHere's a easy sample code..http://www.codeproject.com/aspnet/EasyHit.asp Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now