OK I'm an Idiot.. Can not load a control

Jul 1 2008 1:50 PM

On the test page..

 

<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPages/Site.master" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>
<%
@ MasterType VirtualPath="~/MasterPages/Site.master"/>
<%@ Register src="Controls/CartControl.ascx" tagname="CartControl" tagprefix="uc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="PlaceStyleSheetsHere" Runat="Server">
</
asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="PlaceContentHere" Runat="Server">
<uc1:CartControl ID="crap" runat="server" />
</
asp:Content>

WORKS LIKE A CHARM.. BUT

 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Default2 :SiteBasePage
{
   protected void Page_Load(object sender, EventArgs e)
   {
         
Controls_CartControl ctrl = new Controls_CartControl();
         
Controls.Add(ctrl);
   }
}

DOES NOT WORK AT ALL...

 

What the heck is wrong with this????

 


Answers (2)