Doesnt Fire the Page_load Method
-
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
-
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
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 )
-
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 )
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
-
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
You need to look into the
outputcache
documentations. I always used to implement data caching usingCache.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
-
You need to look into the
outputcache
documentations. I always used to implement data caching usingCache.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