Issue with Usercontrol Injection into page

May 1, 2008 at 8:34 AM
Hi all,

I was wondering if you could help me. I have a page

I have created a page and injected a user control into it. Contained within the user control is a "contact us" form ie 4 fields and submit button. This renders perfectly on the page. However the issue I am having is when the submit button is pressed - nothing happens! I have debugged the application and positioned a break point at the submit buttons code behind click handler but the method never gets called. The Page postbacks etc, but the button inside the injected user control never - code behind method gets hit.

Does anyone know why this is the case and how I can overcome it? If anyone has questions based on what i have described, please ask.

Thanks for any assistance.
May 3, 2008 at 12:15 AM
I ran into something similar with one of my pages and I ended up moving it onto it's own dedicated page. So for example instead of http://www.dscoduc.com/pages/Subscriptions.aspx I just simply created http://www.dscoduc.com/subscriptions.aspx. Then I just manually added the link to my site.master page and viola, everything works... Not sure why, didn't spend any time trying to figure it out. Honestly I never took the time to understand anyone would want to access the page using ~/pages/something.aspx... Also something else I discovered. When accessing a ~/Pages/something.aspx you are actually going through the URL rewriter. So the actual page gets redirected to ~/Page.aspx?id= syntax... This might make handling postback info more difficult; another reason to have the page at the root.

If you want to discuss this more then feel free to drop me a line at http://www.dscoduc.com/contact.aspx

Chris
May 7, 2008 at 10:29 PM
Edited May 7, 2008 at 10:32 PM
I second dscoduc. I'm taking it a step further, changing BE so it can run in a subdirectory of the same application, so I can segregate BE's files - so it is easier to upgrade to newer versions of BE in the future. See "Installing BlogEngine 1.3 in a /blog subdirectory. How?" (http://www.codeplex.com/blogengine/Thread/View.aspx?ThreadId=21461) for more info on a subdirectory installation.

Using BE pages makes a lot of sense if you're just doing some web design of semi-static content (you can edit it anywhere, it goes with BE's settings and look & feel, etc), but for a custom app that merits its own user control, you might be better off separating it from BE.