Nick
Nick

Reputation: 2907

custom ascx control not working with Umbraco 7

I have a simple ascx contact us control that sends an email.

I have been using it over time to various umbraco websites running versions from 4 up to 6.1.5 and it has always worked fine. I have been also tried it with various versions of .NET without problems.

This time I updated it to .NET 4.5 and tested it and then added it in an Umbraco 7 project. It renders fine but when the submit button is pressed the page reloads without a postback and nothing happens. There is no error message in the logs, there is no activity from the form.

The code is such that if there is an error that would be handled and shown on the screen after a postback but the form simply reloads.

I have tried all the usual checks and I can't find absolutely nothing wrong with it. Can anyone suggest why the control wouldn't work on Umbraco 7 or how to find the error that causes a full page refresh?

Thank you

Upvotes: 0

Views: 1365

Answers (1)

sebastiaan
sebastiaan

Reputation: 5917

You can't use usercontrols in MVC views. If you want to use usercontrols still then switch the render engine back to Webforms in umbracoSettings.config, recycle your app pool and recreate all your templates as masterpages. However, I'd advise you to redo the form in MVC. Google: SurfaceController contact form

Upvotes: 1

Related Questions