I'm an Umbraco noob here but I'm sure I'm probably not the first person who's asked this - I just can't find anything on it...
I have a contact form on a page with a submit button on it, nothing complicated, just emails a mailbox.
So using Visual Studio it works as expected, but obviously when I move to Umbraco there is no contact.aspx.cs file with code for the button click event.
My question is, where do I handle this event in Umbraco? Is it possible to have code behind files? Or do I need to use Macros?
If anyone can point me in the right direction I'll be much obliged.
+1 for Daniel's suggestions to wrap the funcitonality in a usercontrol, then either just wrap it in a macro or directly put it on the template (like you would with any other ASP.Net user control and aspx page).
You can of course create code-behind files as well if you so wish, I made a blog post about how that works here.
Sascha, you reference your blog spot that explains how to ceate code-behind files. Can you please resend the link as the one above goes to an unknown page.
Code Behind?
Hi guys
I'm an Umbraco noob here but I'm sure I'm probably not the first person who's asked this - I just can't find anything on it...
I have a contact form on a page with a submit button on it, nothing complicated, just emails a mailbox.
So using Visual Studio it works as expected, but obviously when I move to Umbraco there is no contact.aspx.cs file with code for the button click event.
My question is, where do I handle this event in Umbraco? Is it possible to have code behind files? Or do I need to use Macros?
If anyone can point me in the right direction I'll be much obliged.
Place uncompiled code file in the App_Code folder.. standard asp.net procedure.
As a side note, I would recommend placing your form in a usercontrol and wrapping in a macro.
Hi richard terris,
+1 for Daniel's suggestions to wrap the funcitonality in a usercontrol, then either just wrap it in a macro or directly put it on the template (like you would with any other ASP.Net user control and aspx page).
You can of course create code-behind files as well if you so wish, I made a blog post about how that works here.
Cheers,
Sascha
+1 where? :P
I rarely place uncompiled code in App_Code.. I compile an assembly for everything... that's how I roll.
Sascha, you reference your blog spot that explains how to ceate code-behind files. Can you please resend the link as the one above goes to an unknown page.
is working on a reply...