UserControl macro sub control events not firing. Request.Form is empty.
Hi Guys - I'm trying to squash a bug that has been a big problem latley and I'm all out of ideas.
We have a UserControl macro that forces a visitor to enter their information before being presented with a list of PDF files to download. The user control consists of 3 textboxes and a submit button. The sub controls are part of a package of controls called DevExpress dXperience.
My problem is this: When I render this control on the page using umbraco macros, the page_load events work but the click events for my submit button never fire. I've tried debugging to see why the event doesn't fire and I also found that there is nothing in the Request.Form collection. It appears that while the button is sending the postback to the correct page, it's not actually sending any data.
I've verified that I have a server form tag in my main masterpage and that I don't have any nested form tags. I've also tested this on a standalone page and it works properly when I do that. The problem only seems to arise when I render this through a macro. I've also disabled cache by page and cache personalized and the cache period is set to 0.
Hey Tom - Thanks for the reply. It's actually called an ASPxButton which is basically a glorafied submit button with some visual styles and more server events. I even tried this with a barebones setup containing an asp textbox and an asp button. While debugging, the Form collection has no data which would explain why events aren't firing but what I'm not sure about is why the form is blank.
Now that I think of it it. I'm wondering if the RenderMacroContent method is the culprate here. Unfortunately this is a control that we have to let contributors add/remove as they wish so I cannot harcode the macro it into the template. However I will try hard coding it for the purposes of finding out if it's the RenderMacroContent method.
As I suspected the problem is with RenderMacroContent. I tried hardcoding the same macro onto the page and everything works perfectly. The same macro that is rendered through umbraco.library.RenderMacroContent does not work. Any ideas on why?
Yep - that's it. RenderMacroContent doesn't support usercontrol postbacks. This is a pretty old problem, not sure there's a real solution for it, other than rendering the RTE content from the template instead of passing through RenderMacroContent. Maybe uComponents RenderTemplate might work? Not sure there's going to be a good solution unfortunately.
UserControl macro sub control events not firing. Request.Form is empty.
Hi Guys - I'm trying to squash a bug that has been a big problem latley and I'm all out of ideas.
We have a UserControl macro that forces a visitor to enter their information before being presented with a list of PDF files to download. The user control consists of 3 textboxes and a submit button. The sub controls are part of a package of controls called DevExpress dXperience.
My problem is this: When I render this control on the page using umbraco macros, the page_load events work but the click events for my submit button never fire. I've tried debugging to see why the event doesn't fire and I also found that there is nothing in the Request.Form collection. It appears that while the button is sending the postback to the correct page, it's not actually sending any data.
I've verified that I have a server form tag in my main masterpage and that I don't have any nested form tags. I've also tested this on a standalone page and it works properly when I do that. The problem only seems to arise when I render this through a macro. I've also disabled cache by page and cache personalized and the cache period is set to 0.
Any thoughts?
Is your submit button a LinkButton by chance? I seem to recall issues with that, though normal buttons work fine.
Other than that, nothing stands out. Maybe try posting a stripped down version of the code you're using? Also, which Umbraco version are you on?
Hey Tom - Thanks for the reply. It's actually called an ASPxButton which is basically a glorafied submit button with some visual styles and more server events. I even tried this with a barebones setup containing an asp textbox and an asp button. While debugging, the Form collection has no data which would explain why events aren't firing but what I'm not sure about is why the form is blank.
Here is my code on my masterpage:
Here is my code that renders the macro and places it on the form (within a tab page)
Now that I think of it it. I'm wondering if the RenderMacroContent method is the culprate here. Unfortunately this is a control that we have to let contributors add/remove as they wish so I cannot harcode the macro it into the template. However I will try hard coding it for the purposes of finding out if it's the RenderMacroContent method.
As I suspected the problem is with RenderMacroContent. I tried hardcoding the same macro onto the page and everything works perfectly. The same macro that is rendered through umbraco.library.RenderMacroContent does not work. Any ideas on why?
Yep - that's it. RenderMacroContent doesn't support usercontrol postbacks. This is a pretty old problem, not sure there's a real solution for it, other than rendering the RTE content from the template instead of passing through RenderMacroContent. Maybe uComponents RenderTemplate might work? Not sure there's going to be a good solution unfortunately.
-Tom
is working on a reply...