Reputation: 7201
I am busy learning about Umbraco but I don't see anything on the internet that tells me if Umbraco will allow me to create a custom ASP.NET form using C# code connecting to a SQL Server Database.
Would I have any issues with Umbraco if I need to create such a custom form in ASP.NET and bring it into Umbraco?
Upvotes: 3
Views: 3091
Reputation: 6304
There are two ways (that I know of, at least) where you can implement custom .Net forms in Umbraco (Version 4.7.x and below).
Template-Based
You can build the form directly in the template markup using standard ASP.Net controls and using a <script runat="server" language="c#">
tag. This is standing inline page coding as you would in Visual Studio, so you give up the luxuries of pre-compilation etc.
<%@ Master Language="C#" MasterPageFile="~/umbraco/masterpages/default.master" AutoEventWireup="true" %>
<asp:Content ContentPlaceHolderID="ContentPlaceHolderDefault" runat="server">
<asp:Label ID="myLabel" runat="server" />
</asp:Content>
<script runat="server" language="c#">
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
this.myLabel.Text = "Hello World";
}
}
</script>
Macro-Based
.ascx
to the /usercontrols/
folder..dll
to the /bin/
folder..Net User Control
on the Macro Properties
tab.Your template code will look something like the following:
<%@ Master Language="C#" MasterPageFile="~/umbraco/masterpages/default.master" AutoEventWireup="true" %>
<asp:Content ContentPlaceHolderID="ContentPlaceHolderDefault" runat="server">
<umbraco:Macro Alias="MyForm" MyProperty="Hi!" runat="server" />
</asp:Content>
Upvotes: 3
Reputation: 2215
Another fast and cheap option is using the Contour Forms package. It costs about 99 euros and provides a WYSIWYG interface to creating forms. It has workflow and the ability to store the values in custom tables.
We really like it and it works for probably 75% - 80% of cases where you need a form.
http://umbraco.com/products/more-add-ons/contour.aspx
Upvotes: 1
Reputation: 46879
You can definitely do this in version 4.7 (and earlier versions), by creating a asp.net custom control, and then adding it into the system - its all pretty easy to do.
In V5 you can't create custom controls since it is now MVC based, and as I am just getting upto speed on v5, can't comment on how hard/different it is yet.
Which version are you using?
Upvotes: 0