HighTechTalks DotNet Forums  

IPostBackDataHandler.LoadPostData does not fire on empty postDataKey form fields

ASP.net Building Controls microsoft.public.dotnet.framework.aspnet.buildingcontrols


Discuss IPostBackDataHandler.LoadPostData does not fire on empty postDataKey form fields in the ASP.net Building Controls forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Roy Hodges
 
Posts: n/a

Default IPostBackDataHandler.LoadPostData does not fire on empty postDataKey form fields - 03-03-2004 , 12:11 AM






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.

Reply With Quote
  #2  
Old   
Teemu Keiski
 
Posts: n/a

Default Re: IPostBackDataHandler.LoadPostData does not fire on empty postDataKey form fields - 03-04-2004 , 01:46 PM






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" <admin (AT) aikido-shobukan (DOT) org> wrote

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.



Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.