Dynamic filter on Page_Load and Page_Init

2 posts, 1 answers
  1. Damian
    Damian avatar
    21 posts
    Member since:
    Mar 2013

    Posted 11 Mar 2013 Link to this post

    Hi,

     I know that RadFilter field editor can be added dynamically either on Page_Load or on Page_Init but still don't have a clear idea about its technical difference. Can anyone highlight the difference between those two?

    Thanks,
    Damian.
  2. Answer
    Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 12 Mar 2013 Link to this post

    Hello Damian,

    There are two options for creating adding the RadFilter field editors dynamically - on Page_Load and Page_Init.

    When creating a field editor in the Page_Load event handler, it should be added to the FieldEditors collection first, before its values are set. This is important because no ViewState is managed for the editor before it has been added. Also, be sure to check that IsPostBack is false. Otherwise, you will end up adding the same editors to the RadFilter multiple times.         

    When creating a field editor in the Page_Init event handler, it should be added to the FieldEditors collection after its attributes are set. No ViewState is required for the editor to be persisted as it is recreated on each page initialization.         

    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top