Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. MVC action loading view page twice

MVC action loading view page twice

Scheduled Pinned Locked Moved ASP.NET
helpasp-netdatabasearchitecturequestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    marky777
    wrote on last edited by
    #1

    Hi all. I have an action result in a controller which is hooked up to a view. This view loads twice when i refresh the page and inserts a viwed counter into the DB twice (which is wrong). Is there any reason for this multiple load? Or a way i can check and then bypass it? I have looked through all img src attributes, as this is one of the causes, but the problem still persistss. Any help would be awesome. :thumbsup:

    C S 2 Replies Last reply
    0
    • M marky777

      Hi all. I have an action result in a controller which is hooked up to a view. This view loads twice when i refresh the page and inserts a viwed counter into the DB twice (which is wrong). Is there any reason for this multiple load? Or a way i can check and then bypass it? I have looked through all img src attributes, as this is one of the causes, but the problem still persistss. Any help would be awesome. :thumbsup:

      C Offline
      C Offline
      Claies
      wrote on last edited by
      #2

      The only reason that I can think of that would cause you to have your view load twice would be if your view contains a partial view that is calling code back that returns the view a second time, or perhaps an ajax call that is formatted incorrectly...

      1 Reply Last reply
      0
      • M marky777

        Hi all. I have an action result in a controller which is hooked up to a view. This view loads twice when i refresh the page and inserts a viwed counter into the DB twice (which is wrong). Is there any reason for this multiple load? Or a way i can check and then bypass it? I have looked through all img src attributes, as this is one of the causes, but the problem still persistss. Any help would be awesome. :thumbsup:

        S Offline
        S Offline
        Speto
        wrote on last edited by
        #3

        Hi, I found this...and solved for me... http://oddiandeveloper.blogspot.com/2009/07/aspnet-web-forms-page-loading-twice.html[^] When the image control has no image source then the page load twice...

        Speto!

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups