Hi,
Does anyone know how to populate the maxlength property of an asp:textbox on page load?
I'm getting the value from the my config table in my DB
When I try setting myControl.MaxLength=10 in the onload event
It's not written to the control and when I enter text I'm not restricted at all
I've also tried
Geting error - <%=SummaryLimit%> is not a valid value for Int32.VB Code:
<asp:textbox id="Abstract" Runat="server" Wrap="True" Rows="11" Columns="45" TextMode="MultiLine" maxlength="[HL="#FFFF00"]<%=SummaryLimit%>[/HL]"></asp:textbox> ' And <asp:textbox id="Abstract" Runat="server" Wrap="True" Rows="11" Columns="45" TextMode="MultiLine" maxlength="[HL="#FFFF00"]<%=Convert.ToInt32(SummaryLimit)%>[/HL]"></asp:textbox>
And
<%=Convert.ToInt32(SummaryLimit)%> is not a valid value for Int32.
SummaryLimit Value is declared and assigned as an Int32
VB Code:
Dim m_iSummaryLimit As Int32 = 250 Public Property SummaryLimit() As Int32 Get Return Convert.ToInt32(m_iSummaryLimit) End Get Set(ByVal Value As Int32) m_iSummaryLimit = Convert.ToInt32(Value) End Set End Property




Reply With Quote