Aaron Li's Blog

Write it down before I forget

  Home  |   Contact  |   Syndication    |   Login
  30 Posts | 0 Stories | 21 Comments | 1 Trackbacks

News

Google

Archives

Other's Idea

May 2007 Entries

Page Life Cycle In ASP.NET 2.0 Stage Event What To Do What Done Initialization Page PreInit - change themes, master pages - access properties for a profile master pages, themes, etc. are applied Control Init Page Init - read or initialize properties of controls in the control hierarchy. - add dynamic controls that need to utilize view state Controls are initialized with declarative properties. Page InitComplete - access controls on the page Begin to track view state changes Page Load Page PreLoad...

View State and TextBoxes, CheckBoxes, DropDownLists There is a common misunderstanding among developers that view state is somehow responsible for having TextBoxes, CheckBoxes, DropDownLists, and other Web controls remember their values across postback. I was one of them. This is not the case, because the values are identified via posted back form field values, and assigned in the LoadPostData() method for those controls that implement IPostBackDataHandler. See Scott Mitchell’s article for detail....

Custom Validator Does Not Fire I have code like this, <asp:TextBox ID="txtEmailBody" Runat="server" /> <asp:CustomValidator ID="valEmailBody" Runat="server" ControlToValidate=" txtEmailBody " Display="None" OnServerValidate="Validate_... " ErrorMessage="*" /> CustomValidator event does not fire if the validated control is empty. If the validated control is a required field, it is easy to fix this problem by adding a RequiredFieldValidator control in addition to the CustomValidator....