Hi all,
I have been going around in circles with the implementation of a .NET user control within Umbraco.
Firstly I have created a usercontrol that is a single gridview with codebehind that queries a db and returns results on page load....Nothing new here...
The control works fine outside of Umbraco, yet when I move it into Umbraco and try preview the page I get the following error:
Control 'Cart_2_gvCatalogue' of type 'GridView' must be placed inside a form tag with runat=server.
The code for my Umbraco template is as follows:
Code:<?ASPNET_FORM>
<?UMBRACO_MACRO macroAlias="Cart" ></?UMBRACO_MACRO>
</?ASPNET_FORM>
Just for good measure I have also included my markup for the ASP .NET control:
Code:
<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="Cart.ascx.vb" Inherits="nathanpowell.ecommerce.Cart" %>
<asp:GridView ID="gvCatalogue" runat="server" AllowPaging="True" AutoGenerateColumns="False"
GridLines="None" ShowFooter="True">
<PagerSettings Mode="NumericFirstLast" Position="TopAndBottom" />
<Columns>
<asp:TemplateField>
<HeaderTemplate>
</HeaderTemplate>
<ItemTemplate>
<div id="ProductContainer" runat="server">
<table>
<tr>
<td>
<asp:Image ID="imageProductImageUrl" runat="server" ImageUrl='<%# bind(container.dataitem,"ProductImageUrl") %>' /></td>
<td class="SubHead">
<asp:Label ID="lblProductName" runat="server" Text='<%# Bind(container.dataitem,"ProductName") %>'></asp:Label></td>
</tr>
<tr>
<td>
</td>
<td class="NormalBold">
<asp:Label ID="lblDescription" runat="server" Text='<%# Bind(container.dataitem,"Description") %>'></asp:Label></td>
</tr>
<tr>
<td>
</td>
<td class="Normal">
<asp:PlaceHolder ID="PlaceHolderLineItems" runat="server"></asp:PlaceHolder>
</td>
</tr>
</table>
<!-- Dynamic Div for product information -->
</div>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
Is there something I am missing here? Are there any additional steps to getting .NET controls to work within the Umbraco framework that I am not aware of?
Any advice would be greatly appreciated, I was under the impression that implementing a .NET user control in Umbraco V3 was supposed to be painless... :hmm:
Thanks in advance.