My content page is as follows:
<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Basket.aspx.cs" Inherits="Basket" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
</asp:Content>
Now, I would like to add some controls dynamically to the content when the page loads, so I am trying to execute the following code:
protected void Page_Load(object sender, EventArgs e)
{
Content2.
}
The problem is that the control is Content2not displayed by the compiler, and I get a message that there is no directive or assembly directive.
Any solution?
source
share