Page Directives

  • Thread starter Thread starter DotNetWorks
  • Start date Start date
D

DotNetWorks

Does anyone know of a way to insert a directeve from the
code behind?

Background:

I an creating a custom web control that wraps the IE Web
control tab strip.

The tab strip will still use the IE web control tab items
but the tab strip container will be custom. So I will
need 2 directives inserted when I drop the control on the
form:

<!-- one for ie web controls -->
<%@ Register TagPrefix="iewc"
Namespace="Microsoft.Web.UI.WebControls"
Assembly="Microsoft.Web.UI.WebControls" %>

<!-- one for my custom wrapper -->
<%@ Register TagPrefix="mcwc"
Namespace="MyCompany.CustomWebControls"
Assembly="MyCompany.CustomWebControls" %>

If anyone could give me some insight that would be great.

Thanks, Dan
 
Hi,

You can use these directives when you create the control dynamically with
Page.ParseControl. ParseControl method expects the content as string i.e
directive included first and then the syntax to create the control (to the
same call for Page.ParseControl).
 
Back
Top