Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > RegisterRequiresPostback failing to call LoadPostData

Reply
Thread Tools

RegisterRequiresPostback failing to call LoadPostData

 
 
John Burke
Guest
Posts: n/a
 
      04-23-2004
I am getting a curious problem where LoadPostData is not being called after
registering the control using RegisterRequiresPostback. Other controls not
requiring postback registration are having LoadPostData called. Each
control calling RegisterRequiresPostback does have a uniqueid and exists for
the lifetime of the page, so it's not a mis-referencing problem.

It's worth noting that this was working fine until I killed the Viewstate
and emitted an empty Viewstate hidden field instead. Is it possible that
somewhere in the inner workings of the page class there is some dependency
between RegisterRequiresPostback and the Viewstate?

Any clues?

JB


 
Reply With Quote
 
 
 
 
Teemu Keiski
Guest
Posts: n/a
 
      04-24-2004
Hi,

there is dependency such way that Page class checks existence of VIEWSTATE
and EVENTTARGET form elements at the beginnig of request to detect the
postback mode (it returns the request data collection based on this). If
both __VIEWSTATE and __EVENTTARGET hidden form elements are missing
completely, request collection is null.This same collection is the one that
is passed to the LoadPostData method (still LoadPostData should be called in
any case). But I suppose you have removed only the __VIEWSTATE hidden field,
so it can't be the problem.

Can you tell/post some code that demonstrates where do you do the
registration for postback handling?

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist
http://blogs.aspadvice.com/joteke



"John Burke" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
I am getting a curious problem where LoadPostData is not being called after
registering the control using RegisterRequiresPostback. Other controls not
requiring postback registration are having LoadPostData called. Each
control calling RegisterRequiresPostback does have a uniqueid and exists for
the lifetime of the page, so it's not a mis-referencing problem.

It's worth noting that this was working fine until I killed the Viewstate
and emitted an empty Viewstate hidden field instead. Is it possible that
somewhere in the inner workings of the page class there is some dependency
between RegisterRequiresPostback and the Viewstate?

Any clues?

JB



 
Reply With Quote
 
 
 
 
Sam
Guest
Posts: n/a
 
      04-26-2004
Is it possible that somehow the Viewstate is carrying the ID of the
malfunctioning control? If it wasn't restored before LoadPostData
then of course that event wouldn't fire.

Make sure the ID of the control is being set in Init (either
explicitly or because you add it the the Controls collection) and
doesn't change during the lifecycle. But I assume you've already
tried these simple tests... Once though I had a similiar problem
because I added the control in Init and explicity set its ID in Page
Load, thus inadvertantly skipping the 1st ProcessPostData stage.

-Sam

"John Burke" <(E-Mail Removed)> wrote in message news:<(E-Mail Removed)>...
> I am getting a curious problem where LoadPostData is not being called after
> registering the control using RegisterRequiresPostback. Other controls not
> requiring postback registration are having LoadPostData called. Each
> control calling RegisterRequiresPostback does have a uniqueid and exists for
> the lifetime of the page, so it's not a mis-referencing problem.
>
> It's worth noting that this was working fine until I killed the Viewstate
> and emitted an empty Viewstate hidden field instead. Is it possible that
> somewhere in the inner workings of the page class there is some dependency
> between RegisterRequiresPostback and the Viewstate?
>
> Any clues?
>
> JB

 
Reply With Quote
 
 
 
Reply

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
what does RegisterRequiresPostBack REALLY do?? Sam ASP .Net 2 03-24-2008 03:09 PM
LoadPostData not being called at the right time for controls dynamically added at page load Sam ASP .Net 2 04-26-2004 07:19 AM
RegisterRequiresPostBack and child custom controls Cathead ASP .Net Web Controls 0 10-01-2003 09:11 PM
LoadPostData and LinkButtons Lucas Tam ASP .Net 0 08-18-2003 12:57 PM
LoadPostData William F. Robertson, Jr. ASP .Net 1 07-24-2003 04:39 PM



Advertisments