How to Find Website Visitor No
-
Hi To, I Want to count visitor no of our site and also display it in my site by which user can see his visitor no of site. for which I have written this code in globle asax in application start event and show it in the master page. but the value is reset every time. The code is .. Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs) Application("visitor") = 1 End Sub and the code of session_start is.. Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs) Application("visitor") = CType(Application("visitor"), Integer) + 1 End Sub and display it in the form load int master page Me.Label1.Text = "Visitor No " + Application("visitor").ToString()
-
Hi To, I Want to count visitor no of our site and also display it in my site by which user can see his visitor no of site. for which I have written this code in globle asax in application start event and show it in the master page. but the value is reset every time. The code is .. Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs) Application("visitor") = 1 End Sub and the code of session_start is.. Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs) Application("visitor") = CType(Application("visitor"), Integer) + 1 End Sub and display it in the form load int master page Me.Label1.Text = "Visitor No " + Application("visitor").ToString()
Samarjeet Singh@india wrote:
Me.Label1.Text = "Visitor No " + Application("visitor").ToString()
Of course you don't call it Label1, right ? Of course it's reset. EVery time the application is. You need to persist it somewhere for it to never reset, like a text file or a DB.
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
-
Hi To, I Want to count visitor no of our site and also display it in my site by which user can see his visitor no of site. for which I have written this code in globle asax in application start event and show it in the master page. but the value is reset every time. The code is .. Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs) Application("visitor") = 1 End Sub and the code of session_start is.. Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs) Application("visitor") = CType(Application("visitor"), Integer) + 1 End Sub and display it in the form load int master page Me.Label1.Text = "Visitor No " + Application("visitor").ToString()
-
Samarjeet Singh@india wrote:
Me.Label1.Text = "Visitor No " + Application("visitor").ToString()
Of course you don't call it Label1, right ? Of course it's reset. EVery time the application is. You need to persist it somewhere for it to never reset, like a text file or a DB.
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
Thnks for Reply... Yes it may be value reset but I am taking application type variable then why it is reset from 100 to 1. just give me some hints. is there any way inwhich we can show it with out store db or file....
-
Thnks for Reply... Yes it may be value reset but I am taking application type variable then why it is reset from 100 to 1. just give me some hints. is there any way inwhich we can show it with out store db or file....
Samarjeet Singh@india wrote:
just give me some hints. is there any way inwhich we can show it with out store db or file....
Well, that's what I just told you to do, didn't I ? Which bit are you stuck on ? If you've written a website that is likely to care about a visit count, surely you know how to use a database, or a flat file ?
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
-
Hi To, I Want to count visitor no of our site and also display it in my site by which user can see his visitor no of site. for which I have written this code in globle asax in application start event and show it in the master page. but the value is reset every time. The code is .. Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs) Application("visitor") = 1 End Sub and the code of session_start is.. Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs) Application("visitor") = CType(Application("visitor"), Integer) + 1 End Sub and display it in the form load int master page Me.Label1.Text = "Visitor No " + Application("visitor").ToString()
As Christian said, on application start get that text file/DB to display total number of visitors and on session start get that value,add 1 and save back. :)
Arun Jacob http://codepronet.blogspot.com/
-
Hi To, I Want to count visitor no of our site and also display it in my site by which user can see his visitor no of site. for which I have written this code in globle asax in application start event and show it in the master page. but the value is reset every time. The code is .. Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs) Application("visitor") = 1 End Sub and the code of session_start is.. Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs) Application("visitor") = CType(Application("visitor"), Integer) + 1 End Sub and display it in the form load int master page Me.Label1.Text = "Visitor No " + Application("visitor").ToString()
it's very easy process you may go now this url http://www.amazingcounters.com And Chose Your Visitor Counter Designed & Copy the code or Add ur Site master page...................