473,395 Members | 1,941 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

RegisterRequiresPostback failing to call LoadPostData

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
Nov 18 '05 #1
2 3265
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" <no@offence.net> wrote in message
news:eZ**************@TK2MSFTNGP10.phx.gbl...
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

Nov 18 '05 #2
Sam
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" <no@offence.net> wrote in message news:<eZ**************@TK2MSFTNGP10.phx.gbl>...
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

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Sundeep Gawande | last post by:
I am facing a strange problem. I am trying to host a .NET(C#) control in a VC6 COM ocx. Now when I create the control using CreateControl(...) or CoCreateInstance(...) my call is failing with...
1
by: William F. Robertson, Jr. | last post by:
I have a control called UniqueTextBox, that implements the IPostBackDataHandler. I have trying to use the control in a composite control called UniqueTextBoxEx. The LoadPostData method of the...
0
by: Lucas Tam | last post by:
Hi all, I'm implementing the IPostBackDataHandler interface, and have got it to work somewhat. However, I can't seem to capture any values for Linkbuttons. Do linkbuttons submit any type of...
1
by: Sam | last post by:
According to "Developing Microsoft ASP.NET Server Controls and Components", a control can get the LoadPostData event by using RegisterRequiresPostBack, even if its UniqueID does not match that of...
4
by: Nathan Sokalski | last post by:
During my postbacks, I try to assign the value from an Input tag to a property of a custom control. However, I keep recieving the following error: An exception of type...
0
by: mankuipeng | last post by:
I am doing ActiveReports with .NET environment. There is a ASP.NET page, with custom control on it. Control displays data from database, by editing all the necessary data and click 'Submit' button to...
0
by: tksc234 | last post by:
Hello there. My question is related to full custom server controls. 1) The 'input' element that caused the postback already has 'Me.UniqueID' in its name field. I assumed, the value of postDataKey...
0
by: Nathan Sokalski | last post by:
I have a custom control that inherits CompositeControl implements IPostBackDataHandler and ICallbackEventHandler. In the LoadPostData function, I attempt to use the PostCollection parameter to get...
0
by: Nathan Sokalski | last post by:
I have a custom control that inherits CompositeControl implements IPostBackDataHandler and ICallbackEventHandler. In the LoadPostData function, I attempt to use the postCollection parameter to get...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.