Multiple choice technology web 2.0

Which method displays the custom control?

  1. The Prerender

  2. Render

  3. Page_Load

  4. Display

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The Render method is responsible for generating the HTML output that displays a custom control to the browser. This method is called during the control lifecycle after all processing is complete. Prerender prepares the control, Page_Load handles initialization, and Display is not a standard control method.

AI explanation

In ASP.NET Web Forms, a custom (server) control produces its visible HTML output by overriding the Render method, which writes directly to an HtmlTextWriter to emit markup to the response. PreRender is a lifecycle event that fires just before rendering, used for last-minute state changes, not for producing output. Page_Load handles page initialization logic, not control rendering. Display isn't a standard ASP.NET control method at all. So Render is the correct method that actually displays/outputs the custom control's markup.