OnPreRender vs Page_PreRender
<p>I knew about Page PreRender event and also about overriding OnPreRender, but didn't know existence of Page_PreRender method. Recently while going through this forum i found and search the difference between both but couldn't get much?</p>

<p>Here is my observation:</p>

<p>I have a page with label Label1.</p>

<p>Scenario 1:</p>

<pre><code>    protected void Page_Load(object sender, EventArgs e)
    {
        Label1.Text = "load ";
    }
    protected override void OnPreRender(EventArgs e)
    {
        Label1.Text += "OnPreRender ";
        base.OnPreRender(e);
    }
    private void Page_PreRender(object sender, System.EventArgs e)
    {
        Label1.Text += "Page_PreRender ";
    }
</code></pre>

<p>value of Lable1 would be: load OnPreRender Page_PreRender</p>

<p>Scenario 2:</p>

<pre><code>        protected void Page_Load(object sender, EventArgs e)
        {
            Label1.Text = "load ";
        }
        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);
            Label1.Text += "OnPreRender ";
        }
        private void Page_PreRender(object sender, System.EventArgs e)
        {
            Label1.Text += "Page_PreRender ";
        }
</code></pre>

<p>Note the call order of base.OnPreRender(e);</p>

<p>value of Lable1 would be: load Page_PreRender OnPreRender</p>

<p>I can only say base.OnPreRender(e) is calling Page_PreRender(), but isn't it private?</p>

<p>Can some one please tell, what is difference between both and when to use which?
In general which one should be used?</p>
