ASP.NET interview question:-What is the difference between render and prender event ?

ASP.NET interview question:- What is the difference between render and prender event ?

Answer:

This is again a very nice .NET interview question and  the question can be confusing because of the common word “render”. Now ASP.NET page has 4 important events. Init , Load , validate ,
event and render (Remember SILVER).

Now the final render is a actually a two step process.

1- First the ASP.NET UI objects are saved in to view state.

2- loaded viewstate is assembled to create the final HTML.

The first step is pre-render event and the second step is the render event.

Prerender

This is the event in which the objects will be saved to viewstate.This makes the PreRender event the right place for changing properties of controls or changing Control  structure.Once the PreRender phase  is done those changes to objects are locked in and the viewstate can not be changed. The PreRender step can be overridden using OnPreRender event.

Render.

Render event assembles the HTML so that it can be sent to the browser.In Render event developers can write custom HTML  and override any HTML which is created till now.The Render method takes an HtmlTextWriter object as a parameter and uses that to output HTML to be streamed to the browser. Changes can still be
made at this point, but they are reflected to the client only i.e. the end browser.

View my top interview questions and answers for .NET

Advertisements

About c# and .NET Interview questions

This blog is for developers who want to crack .NET and C# interviews. It has all tips and tricks needed to crack .NET interviews , C# interview , SQL Server interview , Java interview , WCF Interview , Silverlight interview , WPF interview , LINQ interview , Entity framework Interview. Do not forget to watch our Learn step by step video series. Learn MVC in 16 hours:- https://www.youtube.com/watch?v=Lp7nSImO5vk Learn AngularJS Step by Step:- https://www.youtube.com/watch?v=0kmdjqgO9IY Learn Design Pattern in 8 hours:- https://www.youtube.com/watch?v=YDobmucohqk Learn C# and .NET in 60 days:- https://www.youtube.com/watch?v=yh2SrzCkNQA Learn MSBI in 32 hours:- https://www.youtube.com/watch?v=mGPJx3ocFgg Learn SharePoint Step by Step in 8 hours:- https://youtu.be/C2fW76SwJNU
This entry was posted in Uncategorized and tagged , , , , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s