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. Doesnt Fire the Page_load Method

Doesnt Fire the Page_load Method

Scheduled Pinned Locked Moved ASP.NET
helpdatabase
5 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
    M_Menon
    wrote on last edited by
    #1

    Hi there I am having a page with GridView in which i have a Edit button. When i click the Edit button i make Response.Redirect to another page. I make modifications there and press OK or Cancel button which redirects me back to the GridView Page.I see the Updates if i have made. and then when i again click Edit to the same record, it shows me the old data that was there before updation. The reason is because it doesnt go to the Page_load method and doesnt get the latest data from the DataBase. But yes if i click the Cancel or OK button it does go to the Page_load method. So my problem is that when i click Edit button second time for the same record it doesnt go to the page_load method.I know not easy for you to catch the error without seeing my code. If needed please let me know i shall post the required code. Any suggestions or help would be greatly appreciated.

    Cheers Menon

    C 1 Reply Last reply
    0
    • M M_Menon

      Hi there I am having a page with GridView in which i have a Edit button. When i click the Edit button i make Response.Redirect to another page. I make modifications there and press OK or Cancel button which redirects me back to the GridView Page.I see the Updates if i have made. and then when i again click Edit to the same record, it shows me the old data that was there before updation. The reason is because it doesnt go to the Page_load method and doesnt get the latest data from the DataBase. But yes if i click the Cancel or OK button it does go to the Page_load method. So my problem is that when i click Edit button second time for the same record it doesnt go to the page_load method.I know not easy for you to catch the error without seeing my code. If needed please let me know i shall post the required code. Any suggestions or help would be greatly appreciated.

      Cheers Menon

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      Have you set a breakpoint and confirmed it's not fired ? It seems more likely that it's loading from the cache.

      Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

      M 1 Reply Last reply
      0
      • C Christian Graus

        Have you set a breakpoint and confirmed it's not fired ? It seems more likely that it's loading from the cache.

        Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

        M Offline
        M Offline
        M_Menon
        wrote on last edited by
        #3

        Hi Christian Thank you very much. I was really lost thinking what had gone wrong and that my Page_Load is not getting fired. Yes i forgot to mention i always use breakpoints to debug my code when i have problem. And i had also came to the conclusion because i had breakpoints and it was not going to the Page_Load i knew it. Well Your guess was correct it was loading from the Cache. And i got it. I had put the OutputCache in the Page and that was the reason it was loading from the Cache. Again thank you very much i had spent almost 2 days to figure this out. If you can tell me this. Is it wrong to use the OutputCache? I was using OutputCache because the page was bit heavy and i thought it would help the page to open if i use OutputCache. Thank you.

        Cheers Menon

        N 1 Reply Last reply
        0
        • M M_Menon

          Hi Christian Thank you very much. I was really lost thinking what had gone wrong and that my Page_Load is not getting fired. Yes i forgot to mention i always use breakpoints to debug my code when i have problem. And i had also came to the conclusion because i had breakpoints and it was not going to the Page_Load i knew it. Well Your guess was correct it was loading from the Cache. And i got it. I had put the OutputCache in the Page and that was the reason it was loading from the Cache. Again thank you very much i had spent almost 2 days to figure this out. If you can tell me this. Is it wrong to use the OutputCache? I was using OutputCache because the page was bit heavy and i thought it would help the page to open if i use OutputCache. Thank you.

          Cheers Menon

          N Offline
          N Offline
          N a v a n e e t h
          wrote on last edited by
          #4

          You need to look into the outputcache documentations. I always used to implement data caching using Cache.Insert and reading from it. In my scenario, this method gave more handle than outputcache. In this all the events fires correctly. Easy way would be creating a cache utility class which manages caching for all the pages.

          All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions

          M 1 Reply Last reply
          0
          • N N a v a n e e t h

            You need to look into the outputcache documentations. I always used to implement data caching using Cache.Insert and reading from it. In my scenario, this method gave more handle than outputcache. In this all the events fires correctly. Easy way would be creating a cache utility class which manages caching for all the pages.

            All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions

            M Offline
            M Offline
            M_Menon
            wrote on last edited by
            #5

            Hi Navaneeth, Thanks for the reply. I will definitely go through the Topic Caching more deeply wherein i can learn to use it more properly. Thanks

            Cheers Menon

            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