[CLOSED] AjaxEvents Question

  1. #1

    [CLOSED] AjaxEvents Question

    Hello,

    Quick question regarding the AjaxEvents.

    Example.aspx:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <script runat="server">
        protected void chkTest_Checked(object sender, AjaxEventArgs e)
        {
            phTest.Visible = chkTest.Checked;
        }
    </script>
    
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head id="Head1" runat="server">
        <title>Untitled Page</title>
    </head>
    <body>
        <form id="form1" runat="server">
            <ext:ScriptManager runat="server" ScriptMode="Debug" />
                <ExtJS:CheckBox ID="chkTest" runat="server">
                    <AjaxEvents>
                        <Check OnEvent="chkTest_Checked" />
                    </AjaxEvents>
                </ExtJS:CheckBox>&amp;nbsp;Test?
                <asp:PlaceHolder ID="phTest" runat="server" Visible="False">
                    Yes Test!
                </asp:PlaceHolder>
        </form>
    </body>
    </html>
    Is the above possible?

    Cheers,
    Timothy
  2. #2

    RE: [CLOSED] AjaxEvents Question

    Nope. With <AjaxEvents> you can only send back JavaScript in the response. And the JavaScript must be registered with the <ext:ScriptManager>. No html is sent back in the response.

    Setting Coolite Toolkit control Properties or calling Methods will automatically create the necessary JavaScript. We can not (or do not) create JavaScript for non-Coolite controls.

    Your "phTest" is not Visible on initial Page_load, so no html or DOM elements would be added to the Page. On the ajax response no html is returned, so setting phTest.Visible=true would effectively do nothing, at least from a user interface point of view.
    Geoffrey McGill
    Founder
  3. #3

    RE: [CLOSED] AjaxEvents Question

    Good to know!

    You have any suggestions on how to hide a region then? Should I use an Ext Panel instead of an ASP PlaceHolder ?

    Cheers,
    Timothy
  4. #4

    RE: [CLOSED] AjaxEvents Question

    You could add a "hidden" <ext:Panel> with Header and Border set to "False", then call the .SetVisibility() Method in the AjaxEvent.

    Example

    <script runat="server">
        protected void chkTest_Checked(object sender, AjaxEventArgs e)
        {
            this.Panel1.SetVisible(chkTest.Checked);
        }
    </script>
    
    <ext:Panel 
        ID="Panel1" 
        runat="server" 
        Hidden="True"
        Header="False"
        Border="False">
        <Content>Yes Test!</Content>
    </ext:Panel>
    Hope this helps.

    Geoffrey McGill
    Founder

Similar Threads

  1. [CLOSED] Yet another AjaxEvents Confirmation Message Question
    By ljcorreia in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Feb 08, 2010, 8:37 AM
  2. [CLOSED] ajaxevents question
    By alexp in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jan 26, 2009, 11:08 AM
  3. [CLOSED] AjaxEvents working?
    By Timothy in forum 1.x Legacy Premium Help
    Replies: 15
    Last Post: Nov 16, 2008, 4:22 PM
  4. Yet another AjaxEvents question
    By ljcorreia in forum 1.x Help
    Replies: 6
    Last Post: Nov 14, 2008, 5:39 PM
  5. [CLOSED] AjaxEvents
    By Timothy in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Sep 10, 2008, 6:37 PM

Posting Permissions