S
Sergei Shelukhin
I wrote ascx control that resides in A namespace.
I had several controls from that namespace written as simple C# classes
(without ascx part) and they worked ok with
<%@ Register TagPrefix="tc" NameSpace="A" Assembly="A" %>
However, ascx control refused to render - it just rendered to empty
string.
The interesting thing is that there were no errors, compile time or
runtime, no warnings, and control methods did get called (I tried
overriding render and placing a brekapoint there - it got hit), if I
tried to render control into string in Page_Load it returned an empty
string.
The fix was as simple as adding the following declaration to the page:
<%@ Register TagPrefix="tc1" TagName="MyControl"
Src="~/Component/MyControl.ascx" %>
and changing the control tag prefix accordingly.
I had several controls from that namespace written as simple C# classes
(without ascx part) and they worked ok with
<%@ Register TagPrefix="tc" NameSpace="A" Assembly="A" %>
However, ascx control refused to render - it just rendered to empty
string.
The interesting thing is that there were no errors, compile time or
runtime, no warnings, and control methods did get called (I tried
overriding render and placing a brekapoint there - it got hit), if I
tried to render control into string in Page_Load it returned an empty
string.
The fix was as simple as adding the following declaration to the page:
<%@ Register TagPrefix="tc1" TagName="MyControl"
Src="~/Component/MyControl.ascx" %>
and changing the control tag prefix accordingly.