[CLOSED] ListView with HtmlEditor -> HtmlEditor value is null

  1. #1

    [CLOSED] ListView with HtmlEditor -> HtmlEditor value is null

    Hello,

    Attached is a sample with a HtmlEditor inside a listview.

    Steps to reproduce the problem:
    1. Type any text inside the HtmlEditor;
    2. Press any of the two submtis button;
    3. The text from the HtmlEditor should be displayed in the Alert, but it is not.

    Ps: I couldnt attach a zip file, so I had to host it somewhere else.

    Link: http://www.filedropper.com/webapplication2

    Thanks
    Last edited by geoffrey.mcgill; Apr 17, 2012 at 4:15 AM. Reason: [CLOSED]
  2. #2
    Hi,

    It would be best to just post a simplified .aspx here in the forums between [CODE] tags. That way we can all just quickly scan the code, and it can be indexed by search engines.
    Geoffrey McGill
    Founder
  3. #3
    The problem is in an user control, so I am not sure how to make this a single class, like you said.
  4. #4
    Quote Originally Posted by SouthDeveloper View Post
    The problem is in an user control, so I am not sure how to make this a single class, like you said.
    If the .aspx is not required, just post a simplified .ascx. We'll just drop that .ascx onto an empty .aspx.

    Here's a few posts to review when submitting topics to the forums:

    http://forums.ext.net/showthread.php...ing-New-Topics

    http://forums.ext.net/showthread.php...ation-Required
    Geoffrey McGill
    Founder
  5. #5
    No problem.

    Here it its:

    Default.aspx
        <asp:ListView runat="server" ID="ListView1">
            <ItemTemplate>
                <scott:UserControl1 runat="server" />
            </ItemTemplate>
        </asp:ListView>
    Default.aspx.cs
            protected void Page_Load(object sender, EventArgs e)
            {
                var list = new List<string> { "Name1", "OtherName" };
                ListView1.DataSource = list;
                ListView1.DataBind();
            }

    UserControl1.aspx
    <ext:HtmlEditor ID="HtmlEditor1" runat="server" />
    <ext:Button OnDirectClick="Button1Click" runat="server" Text="Client Click" />
    <ext:Button OnClientClick="#{DirectMethods}.Button1DirectMethodClick();" runat="server" Text="Direct Method" />
    UserControl1.aspx.cs
            [DirectMethod]
            public void Button1DirectMethodClick()
            {
                X.Msg.Alert("Msg", HtmlEditor1.Text).Show();
            }
    
            protected void Button1Click(object sender, DirectEventArgs e)
            {
                X.Msg.Alert("Msg", HtmlEditor1.Text).Show();
            }
    Thanks
  6. #6
    Hi,

    Move data binding to Page_Init instead Page_Load
  7. #7
    Hi,

    The DirectEvent worked, but not the DirectMethod.

    This is what is happening:
    If you leave <compilation debug="true"/> in the web.config, everything works fine.
    If you remove <compilation debug="true"/>, when you press the first button 'Direct Method', it will display the value of the second htmleditor, not the first, like the direct event.

    I need to remove compilation debug = true for the production environment.

    I dont know why this happens.

    Also, what's the difference in page_load and page_init for ext.net in this case?

    This is the same problem I am having: http://forums.ext.net/showthread.php...ed=1#post79536

    Thanks
  8. #8
    Hi,

    DirectMethod issue is fixed, please update from SVN

    Also, what's the difference in page_load and page_init for ext.net in this case?
    It is not ext.net case, it is ASP.NET loading postback values aspect (all dynamic controls should be recreated in Page_Init, atleast it is recommended)
    You can replace HtmlEditor by ASP.NET TextBox and you will see the same issue
  9. #9
    Fixed.

    Thanks

Similar Threads

  1. HtmlEditor
    By arya009 in forum 1.x Help
    Replies: 10
    Last Post: Dec 03, 2012, 8:32 PM
  2. Replies: 4
    Last Post: Jul 18, 2011, 5:21 PM
  3. [CLOSED] HtmlEditor
    By ndotis in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Dec 20, 2010, 9:23 PM
  4. [CLOSED] HtmlEditor
    By state in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Sep 10, 2009, 5:21 PM
  5. [CLOSED] HtmlEditor
    By Timothy in forum 1.x Legacy Premium Help
    Replies: 7
    Last Post: Sep 23, 2008, 8:44 AM

Posting Permissions