Problem with MAXHTMLLENGTH and MAXTEXTLENGTH

Last post 06-25-2009, 4:03 AM by Kenneth. 1 replies.
Sort Posts: Previous Next
  •  06-23-2009, 11:50 AM 53414

    Problem with MAXHTMLLENGTH and MAXTEXTLENGTH

    Hello,
     
    I am using 6.3, and I can't have maxhtmllength and maxtextlength to work.
     
    Whatever the values I put, it doesn't change anything and it has no limit.
     
    CE is in EditItemTemplates inside formviews like here:

    <asp:FormView ID="FormView2" runat="server" DataKeyNames="idpage" DataSourceID="SqlDataSource1"

    DefaultMode="Edit" BackColor="WhiteSmoke">

    <EditItemTemplate>

    <asp:Label ID="idpageLabel1" runat="server" Visible="false" Text='<%# Eval("idpage") %>'></asp:Label><br />

    <CE:Editor ID="Editor1" runat="server" Width="750px" MaxTextLength="200" AutoConfigure="Simple" Text='<%# Bind("contenupage") %>'>

    </CE:Editor>

    <asp:TextBox ID="nompageTextBox" Visible="false" runat="server" Text='<%# Bind("nompage") %>'>

    </asp:TextBox><br />

    <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update"

    Text="Mettre jour">

    </asp:LinkButton>

    <asp:LinkButton ID="UpdateCancelButton" runat="server" CausesValidation="False" CommandName="Cancel"

    Text="Annuler">

    </asp:LinkButton>

    </EditItemTemplate>

    </asp:FormView>
     
    Is it because of the implementation inside a formwiew ?
     
    I have also tried to setup on code behind, but same result so far.
     
    Any idea ?
     
    Thanks a lot
  •  06-25-2009, 4:03 AM 53494 in reply to 53414

    Re: Problem with MAXHTMLLENGTH and MAXTEXTLENGTH

    Hi michcb,
     
    Try this example
     
    1. <%@ Page Language="C#" Debug="true" %>   
    2. <%@ Import Namespace="System.Data" %>   
    3. <%@ Register TagPrefix="CE" Namespace="CuteEditor" Assembly="CuteEditor" %>   
    4. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">   
    5.   
    6. <script runat="server">   
    7.     ICollection CreateDataSource()   
    8.     {   
    9.         DataTable dt = new DataTable();   
    10.         DataRow dr;   
    11.         dt.Columns.Add(new DataColumn("IntegerValue"typeof(Int32)));   
    12.         for (int i = 0; i < 3; i++)   
    13.         {   
    14.             dr = dt.NewRow();   
    15.   
    16.             dr[0] = i;   
    17.             dt.Rows.Add(dr);   
    18.         }   
    19.   
    20.         DataView dv = new DataView(dt);   
    21.         return dv;   
    22.     }   
    23.     void Page_Load(Object sender, EventArgs e)   
    24.     {   
    25.         if (!IsPostBack)   
    26.         {   
    27.             FormView2.DataSource = CreateDataSource();   
    28.             FormView2.DataBind();   
    29.         }   
    30.     }   
    31. </script>   
    32.   
    33. <html xmlns="http://www.w3.org/1999/xhtml">   
    34. <head runat="server">   
    35.     <title>Untitled Page</title>   
    36. </head>   
    37. <body>   
    38.     <form id="form1" runat="server">   
    39.     <p>input more than 10 characters and click on the postback button</p>   
    40.         <asp:FormView ID="FormView2" AllowPaging="true" runat="server" DefaultMode="Edit"  
    41.             BackColor="WhiteSmoke">   
    42.             <EditItemTemplate>   
    43.                 <CE:Editor ID="Editor1" runat="server" Width="750px" MaxTextLength="10" AutoConfigure="Simple">   
    44.                 </CE:Editor>   
    45.             </EditItemTemplate>   
    46.             <PagerSettings Position="Bottom" Mode="Numeric" />   
    47.         </asp:FormView>   
    48.         <asp:Button ID="button1" runat="server" Text="PostBack" />   
    49.     </form>   
    50. </body>   
    51. </html>  
     
    Regards,
     
    Ken
View as RSS news feed in XML