Ask a Question related to Dreamweaver AppDev, Design and Development.
-
btn #1
How many times a page is viewed?
Hi - using ASP/Acsess/Vb How can I display the number of times a dynamic page
is displayed/ clicked? Like this pagedetails.asp?ID=82 viewed 5 times, ID=83
viewed 10 times, and so on... Thanx! Bjorn.
btn Guest
-
Using the same User Control multiple times on one page
How can I reuse a User Control multiple times on a single page? I have one created that pulls and hyperlinks the most recent news items from the... -
Setting values of Controls used multiple times on a page
Hello, I have created a custom dropdownlist that is used multiple times within a single page. When trying to set the values of the controls with... -
Web page is too slow when running at the first times
Do we have the way to run my web page at the first times that is not SLOW ? I realize that comes from compiling to machine code at the first... -
<embed> referenced page called 2 times
When I use an embed tag that uses a dynamic aspx page, the dynamic aspx page appears to get called 2 times instead. Below is code that adds an... -
Error when starting page at this first times
I always found that web page written by ASP.NET (VB.NET) generate error when starting at the first times. If I click refresh button on the IE again,... -
Paul Whitham TMM #2
Re: How many times a page is viewed?
You are going to have to store the information in a database and write an
initial insert script and then and update script that will fire in the
background when the page is loaded.
--
Regards
Paul Whitham
Macromedia Certified Professional for Dreamweaver MX2004
Valleybiz Internet Design
[url]www.valleybiz.net[/url]
Team Macromedia Volunteer for Ultradev/Dreamweaver MX
[url]www.macromedia.com/support/forums/team_macromedia[/url]
"btn" <webforumsuser@macromedia.com> wrote in message
news:d2pd54$3fa$1@forums.macromedia.com...page> Hi - using ASP/Acsess/Vb How can I display the number of times a dynamicID=83> is displayed/ clicked? Like this pagedetails.asp?ID=82 viewed 5 times,> viewed 10 times, and so on... Thanx! Bjorn.
>
Paul Whitham TMM Guest
-
UltraDav #3
Re: How many times a page is viewed?
it's not as hard as it can sound
you need a single field in your db table wherever you want to count, i call
mine "viewCount".
then when setting your detail page up, find your recordset code, and add :
sample code for a recordset called rs_lets
rs_lets.CursorType = 0
rs_lets.CursorLocation = 2
rs_lets.LockType = 3
rs_lets("ViewCount") = rs_lets.Fields.Item("ViewCount").Value + 1
rs_lets.Update
add it just before the :
rs_lets.Open()
to display it just response.write the viewCount field in your repeat region or
Record nav bar.
shout if ya need any more help
Dave
UltraDav Guest
-
UltraDav #4
Re: How many times a page is viewed?
it's not as hard as it can sound
you need a single field in your db table wherever you want to count, i call
mine "viewCount".
then when setting your detail page up, find your recordset code, and add :
sample code for a recordset called rs_lets
rs_lets.CursorType = 0
rs_lets.CursorLocation = 2
rs_lets.LockType = 3
rs_lets("ViewCount") = rs_lets.Fields.Item("ViewCount").Value + 1
rs_lets.Update
add it just before the :
rs_lets.Open()
to display it just response.write the viewCount field in your repeat region or
Record nav bar.
shout if ya need any more help
Dave
UltraDav Guest
-
btn #5
Re: How many times a page is viewed?
Hi. Thanx for reply. Have tested this but got an error; ADODB.Field
(0x800A0E78) Operation not allowed when object is closed /test.asp, line 20
Here is my recordset; <% Dim profiler Dim profiler_numRows Set profiler =
Server.CreateObject('ADODB.Recordset') profiler.ActiveConnection =
MM_test_STRING profiler.Source = 'SELECT * FROM profiler WHERE ID = ' +
Replace(profiler__MMColParam, ''', '''') + '' profiler.CursorType = 0
profiler.CursorLocation = 2 profiler.LockType = 3 profiler('ViewCount') =
profiler.Fields.Item('ViewCount').Value + 1 profiler.Update profiler.Open()
profiler_numRows = 0 %> Line 20 is yours; profiler('ViewCount') =
profiler.Fields.Item('ViewCount').Value + 1 Any suggestions?
btn Guest
-
UltraDav #6
Re: How many times a page is viewed?
silly me i type too fast.
i missed out the "." between profiler + ("viewCount")
so after profiler add a full stop.
forgot to mention also that your column must be a number field, (int), so it
can add the value properly.
UltraDav Guest
-
btn #7
Re: How many times a page is viewed?
Hi again. Struggling with this script and I often get an unspecified error, I
guess reffering to an unclosed connection or something. Could you please
setup the whole recordset for me as It should be on my page. Maybe I`m missing
something here. My recordset is in my previous postings on this issue. Many
thanx for all help! Bjorn.
btn Guest
-
btn #8
Re: How many times a page is viewed?
Hi again. Here is my complete recordset, but I cant find out what is wrong.
Simply wont work. <% Dim profiler Dim profiler_numRows Set profiler =
Server.CreateObject('ADODB.Recordset') profiler.ActiveConnection =
MM_test_STRING profiler.Source = 'SELECT * FROM profiler WHERE ID = ' +
Replace(profiler__MMColParam, ''', '''') + '' profiler.CursorType = 0
profiler.CursorLocation = 2 profiler.LockType = 3 profiler.('ViewCount') =
profiler.Fields.Item('ViewCount').Value + 1 profiler.Update profiler.Open()
profiler_numRows = 0 %> Any suggestions?
btn Guest



Reply With Quote

