Data loss in membership control postback

Apr 12, 2008 at 3:27 PM
Edited Apr 12, 2008 at 3:58 PM
Hi,

I'm using the CSSFriendly adapters along with a MySQL membership provider. The membership provider seems to work ok until I enable the CSSFriendly adapter. I've looked around and seen a thing on double postbacks, but I don't seem to be getting those.

On checking the submission to the page (just throwing a breakpoint into Page_Prerender - the breakpoint is hit and according to the sender object we're getting nothing from the controls... Username & Password come up empty according to the control.

I'm going to do some more digging, I can't see it just being me though so I'm hoping someone can point me in the right direction if they've been here before & fixed it.


  • Just in case there's a problem with the built dll I'm using, I've pulled the source down & compiled the dll myself and I've set the copdeplex client up to get regular updates.

  • edit : I've set up a site with just a straight SQLExpress membership provider and that appears to be working but doing double postbacks - at least if breaking in the Page_Load event is anything to do with it.
May 22, 2008 at 11:50 PM
Edited May 23, 2008 at 12:12 AM
I've nailed the source of the problem, ruled out custom membership provider and have a workaround.  The custom membership provider part was a red herring.

Answer: if the ID for the contentplaceholder contains an underscore then no data is returned during the postback.  It's easy-peasy to repro as well...

Steps to reproduce...
In a new project, add the bin folder containing the dll and the app_browsers containing the browser file.

Create a new masterpage.
Change the ID of the contentplaceholder to _ContentPlaceHolder1
Save & Close

Create a new web form based on the masterpage
Add a CreateUserWizard
Save & Run

Fill in the form hit create user and stand by for... nothing.

Workaround: avoid underscores in the contentplaceholder id's for the time being.  I have an underlying theory as to why it fails and if I'm right then it may stretch to affect other control ID's too such as the createuserwizard itself or container controls but I've left that untested for now.  I'm going to look into the code to find out where things are going astray and see if I can work out a patch.