1
Answer

Can we implement both OnInit() and Page_Init in a Page ?

Jagan Mohan

Jagan Mohan

11y
2.5k
1

 Hi to all. I do have a small doubt regarding ASP.NET Page Life Cycle events. When I gone through the coding of an application i came to see both overriding of OnInit() method and also Page_Init event in same Page. I thought both the approaches serves the same purpose and I have seen mostly the implementation of overriden OnInt() only but not both. Most of the articles in the web explains about the better approach in these two but no one explained what happens if we implement both in a Page. Also explain what is the difference between writing some code before calling base.OnInit(e) and after calling base.OnInit(e). What does this situation means. Can anyone please help me regarding this.

                                                                                          Thanks in Advance.

Answers (1)