H
hiriumi
I have an conversion issue from ASP .NET 1.1 to 2.0.
I used to be able to create a class that inherits from any class under
System.Web.UI.HtmlControls and register the namespace in which the
class lives.
In ASP .NET 2.0, the same principle is working if the classes inherit
from System.Web.UI.WebControls.WebControl (or any class that inherits
from WebControl class), but if the class inherits from classes under
System.Web.UI.HtmlControls, I can't seem to use them as the custom tag.
So what I want to do is... let's say I got a class that inherits from
System.Web.UI.HtmlControls.HtmlInputButton and its class name is
MyButtonControl. And the class belongs to MyWebApp namespace. Of
course, MyButtonControl class has some custom code in it. And then, in
one of the .aspx page, I would have the following.
<% Register TagPrefix="MyControls" Namespace="MyWebApp" %>
And then I should be able to use MyButtonControl like the following.
<MyControls:MyButtonControl id="btnWhatever" runat="server" />
What can I do to accomplish this in ASP .NET 2.0?
I used to be able to create a class that inherits from any class under
System.Web.UI.HtmlControls and register the namespace in which the
class lives.
In ASP .NET 2.0, the same principle is working if the classes inherit
from System.Web.UI.WebControls.WebControl (or any class that inherits
from WebControl class), but if the class inherits from classes under
System.Web.UI.HtmlControls, I can't seem to use them as the custom tag.
So what I want to do is... let's say I got a class that inherits from
System.Web.UI.HtmlControls.HtmlInputButton and its class name is
MyButtonControl. And the class belongs to MyWebApp namespace. Of
course, MyButtonControl class has some custom code in it. And then, in
one of the .aspx page, I would have the following.
<% Register TagPrefix="MyControls" Namespace="MyWebApp" %>
And then I should be able to use MyButtonControl like the following.
<MyControls:MyButtonControl id="btnWhatever" runat="server" />
What can I do to accomplish this in ASP .NET 2.0?