Professional Web Applications Themes

IPostBackDataHandler.LoadPostData does not fire on empty postDataKey form fields - ASP.NET Building Controls

After creating a custom MultiSelectBox that has a checkbox list, i noticed that the control wasn't updating it's selected listitems when no checkboxes were selected. After inserting a Response.Write(postDataKey) in the LoadPostData(...) method, I noticed that LoadPostData is not called when the field is empty! It is called properly when and only when there is a value in the field associated with the postDataKey I'm going to try creating a dummy field with text in it to force LoadPostData to fire....

  1. #1

    Default IPostBackDataHandler.LoadPostData does not fire on empty postDataKey form fields

    After creating a custom MultiSelectBox that has a checkbox list, i noticed that the control wasn't updating it's selected listitems when no checkboxes were selected. After inserting a Response.Write(postDataKey) in the LoadPostData(...) method, I noticed that LoadPostData is not called when the field is empty! It is called properly when and only when there is a value in the field associated with the postDataKey

    I'm going to try creating a dummy field with text in it to force LoadPostData to fire.
    Roy Hodges Guest

  2. #2

    Default Re: IPostBackDataHandler.LoadPostData does not fire on empty postDataKey form fields

    Hi,

    if I recall correctly, if you call Page.RegisterRequiresPostBack with
    reference to the control itself, you'll get LoadPostdata to be called
    despite if control actually posts something to the server (as is case when
    checkbox is not selected, no value is posted). You'd call this from the
    control itself to make sure everything works smoothly.

    --
    Teemu Keiski
    MCP, Microsoft MVP (ASP.NET), AspInsiders member
    ASP.NET Forum Moderator, AspAlliance Columnist

    "Roy Hodges" <adminaikido-shobukan.org> wrote in message
    news:85EA5355-8A59-42CA-8991-C1307BD3DD29microsoft.com...
    After creating a custom MultiSelectBox that has a checkbox list, i noticed
    that the control wasn't updating it's selected listitems when no checkboxes
    were selected. After inserting a Response.Write(postDataKey) in the
    LoadPostData(...) method, I noticed that LoadPostData is not called when the
    field is empty! It is called properly when and only when there is a value in
    the field associated with the postDataKey.

    I'm going to try creating a dummy field with text in it to force
    LoadPostData to fire.


    Teemu Keiski Guest

Similar Threads

  1. Check Empty form fields
    By wavesurfer in forum Macromedia Exchange Dreamweaver Extensions
    Replies: 0
    Last Post: August 19th, 10:05 AM
  2. System.OverflowException during IPostBackDataHandler.LoadPostData
    By Nathan Sokalski in forum ASP.NET Building Controls
    Replies: 4
    Last Post: July 21st, 06:44 PM
  3. Empty Fields
    By HMOKeefe in forum Coldfusion - Getting Started
    Replies: 12
    Last Post: October 14th, 03:43 PM
  4. Replies: 2
    Last Post: August 12th, 02:52 PM
  5. Omitting form fields if empty
    By JDJones in forum PHP Development
    Replies: 1
    Last Post: September 8th, 06:20 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139