No.
You can dynamically load user controls via Page.LoadControl which would
allow you to load one user control or another based on some condition. But
you seem to want to change the @Control directive programmatically in order
to specify a codebehind instead of a src. First of all, the two aren't
interchangable, codebehind and src are nothing to each other. Ignore
CodeBehind, all that does it tell VS.Net which file to open. Rather, the
runtime uses either inherits or src in order to determine which file to
compile in order to serve as the base class. Even with that little lesson,
as far asI know you can't change it. I'm not sure WHY you'd want to....
Karl
--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"RC" <rc@gmail.com> wrote in message
news:%2*****************@TK2MSFTNGP14.phx.gbl...
Is it possible to do following task? Any concret sample code to do that?
Following code is not work.
<% if ((bool)Application["debug"]){
Control codebehind="abc.cs" inherts="ABC.ClassA"
else {
Control src="abc.ascx.cs" inherts="ABC.ClassA"
}%>
thanks