In which method can the final changes to the controls can be done before the page is rendered?
-
Init
-
Load
-
Prerender
-
Render
C
Correct answer
Explanation
The PreRender event is the last stage in the ASP.NET page lifecycle where you can modify controls and their properties before the page is actually rendered to HTML. During the Render phase, the HTML output is generated and written to the response stream, so any changes made after PreRender would not be reflected in the output. The Init and Load events occur earlier in the lifecycle and are used for initialization and loading logic respectively.