Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 593201
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T15:49:14+00:00 2026-05-13T15:49:14+00:00

Assume I have an asp:GridView with some customer information. On that page I also

  • 0

Assume I have an asp:GridView with some customer information. On that page I also have a button which allows me to add a new user to the GridView. When I add the click the user, I databind the gridview again in the button click. Correct me if I am wrong, but if the asp.net lifecycle or at least part of it is in the following order:

page_load
Hookup event handlers such as my button click
page_preRender

Does this mean that if I put the databinding for the gridview in preRender, that is the only place I need to worry about calling it. I can remove it from the button click. This is what I think, but I am not sure if my thinking is correct, so I would like some more insight as to the benefit of putting code in PreRender as opposed to PageLoad

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T15:49:15+00:00Added an answer on May 13, 2026 at 3:49 pm

    By PreRender, you assume that most logic in the page that would affect the binding result has been completed (usually in Page_Load, but anywhere earlier really).

    Controls in the .Net framework by default do their binding in the PreRender event (makes sense, bind to the datasource at the last possible moment…could be that you changed the data 400 times earlier in the lifecycle). Here’s the full layout of the 2.0 lifecycle for reference.

    PreRender – Before this event occurs:

    • The Page object calls EnsureChildControls for each control and for the page.
    • Each data bound control whose DataSourceID property is set calls its DataBind method. For more information, see Data Binding Events for Data-Bound Controls later in this topic.

    The PreRender event occurs for each control on the page. Use the event to make final changes to the contents of the page or its controls.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Assume you have a page in ASP.NET where it makes sense to use JavaScript/jQuery
First hi and thanks in advance in ASP.NET : assume that i have a
I am writing a web application on Asp.Net MVC 3. Assume that we have
I have an ASP.NET application which features some server-side includes. For example: <!--#include virtual=/scripts.inc
If I have an MVC3 ASP.net page which contains a the model iEnumerable<mymodel.CarsForHire> -
Let's assume you have a big complex index page, that shows news articles and
Assume we have an ASP.NET MVC3 Web site that makes use of Entity Framework
On an ASP.NET GridView, I have a field that prints a string from the
Let's say I have some Classic ASP pages that produce all output via Response.Write.
Lets assume that I have retrieved page html using HttpWebRequest & StreamReader . Now

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.