R
Richard Purchas
Hi All
I'm in the process on converting a ASP.Net 2003 control over to ASP.Net
2005, and have come across some unwanted behavioural changes in the 2.0
framework. Here's the background:
The control, which inherits from Textbox, has a 'FormatType' property which
can have values like 'Decimal, 'Date etc. When Decimal is set, the adds an
instance of another custom 'helper' control, in this case, a popup
Calculator. When the FormatType is 'Date', the helper control is a popup
Calendar etc.
In ASP.Net 2003 (framework 1.1), the following aspx page scrips is generated
<cc1:generaltextbox id="GeneralTextBox1" runat="server" decimalplaces="2"
formatstring="#,##0.00"
formattype="Decimal" showhelper="True" width="144px"></cc1:generaltextbox>
In ASP.Net 2005 (framework 2.0), its different, and includes script for the
child popup control::
<cc1:generaltextbox id="GeneralTextBox1" runat="server" decimalplaces="2"
formatstring="#,##0.00"
formattype="Decimal" showhelper="True"
width="192px"><cc2
opupCalculator runat="server" JavaScriptPath="scripts/"
DecimalPlaces="0" ID="PopupCalculator"
LinkedControlID="GeneralTextBox1"><asp:Image runat="server" ToolTip="Click
this to access the calculator" ID="imgButton"
ImageUrl="Images/calculator.gif"></asp:Image>
</cc2
opupCalculator>
</cc1:generaltextbox>
This causes the following error to be thrown in design time:
"Textbox cannot have children of type 'PopupCalculator'
I'm aware that there are other ways of addressing this issue, such as
rewiting the control as a Composite control; however, I'd like to continue
with the way it is for the short-term.
Does anyone know how to change this design-time behaviour, and basically
suppress the child control's definiition being persisted ?
TIA
I'm in the process on converting a ASP.Net 2003 control over to ASP.Net
2005, and have come across some unwanted behavioural changes in the 2.0
framework. Here's the background:
The control, which inherits from Textbox, has a 'FormatType' property which
can have values like 'Decimal, 'Date etc. When Decimal is set, the adds an
instance of another custom 'helper' control, in this case, a popup
Calculator. When the FormatType is 'Date', the helper control is a popup
Calendar etc.
In ASP.Net 2003 (framework 1.1), the following aspx page scrips is generated
<cc1:generaltextbox id="GeneralTextBox1" runat="server" decimalplaces="2"
formatstring="#,##0.00"
formattype="Decimal" showhelper="True" width="144px"></cc1:generaltextbox>
In ASP.Net 2005 (framework 2.0), its different, and includes script for the
child popup control::
<cc1:generaltextbox id="GeneralTextBox1" runat="server" decimalplaces="2"
formatstring="#,##0.00"
formattype="Decimal" showhelper="True"
width="192px"><cc2
DecimalPlaces="0" ID="PopupCalculator"
LinkedControlID="GeneralTextBox1"><asp:Image runat="server" ToolTip="Click
this to access the calculator" ID="imgButton"
ImageUrl="Images/calculator.gif"></asp:Image>
</cc2
</cc1:generaltextbox>
This causes the following error to be thrown in design time:
"Textbox cannot have children of type 'PopupCalculator'
I'm aware that there are other ways of addressing this issue, such as
rewiting the control as a Composite control; however, I'd like to continue
with the way it is for the short-term.
Does anyone know how to change this design-time behaviour, and basically
suppress the child control's definiition being persisted ?
TIA