How many times a page is viewed?

Ask a Question related to Dreamweaver AppDev, Design and Development.

  1. #1

    Default 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

  2. Similar Questions and Discussions

    1. 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...
    2. 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...
    3. 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...
    4. <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...
    5. 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,...
  3. #2

    Default 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...
    > 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.
    >

    Paul Whitham TMM Guest

  4. #3

    Default 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

  5. #4

    Default 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

  6. #5

    Default 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

  7. #6

    Default 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

  8. #7

    Default 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

  9. #8

    Default 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

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139