Click here to Skip to main content
15,885,622 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
One of the developer written this code earlier, now when I am looking into this method bit of difficulty to understand....



C#
protected override void OnPreRender(EventArgs e)
    {
        base.OnPreRender(e);

        if (formMode != (int)HR.Dal.FormMode.New && formSaveMode == (int)SaveMode.No)
        {
            SetValues();
        }
        else
        {
            CreateDependentsRow(-1);
        }
    }
Posted
Updated 14-Sep-15 3:25am
v2
Comments
Thanks7872 14-Sep-15 9:14am    
And you are suppose to explain that 'doubts', than only it will make a question. Use improve question link at the bottom of the question and update it with your 'doubts'.

1 solution

Hi,

Have a read up about ASP.NET Page Life Cycle Events.

Some Article For You:
ASP.NET Page Life Cycle Events[^]
A Dive into ASP.NET Page Life Cycle[^]

The main reason to use pre_render events is to make changes to control properties after databinding events have completed, but before the ViewState is written.

... hope it helps.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900