A question about Event

  1. #1

    A question about Event

    when we click the button ,It will aotu running the DirectEvent;Can I do something such as :Made a Judgment on server,if ture then run the DirectEvent,Otherwise don't do anything?
  2. #2
    Hi,

    You can prevent a DirectEvent on client side returning false from its Before handler.
  3. #3
    Quote Originally Posted by Daniil View Post
    Hi,

    You can prevent a DirectEvent on client side returning false from its Before handler.
    But I want to Made a Judgment on server!
  4. #4
    I'm afraid I don't understand the requirement.

    Do you need a separate request to server to determine should DirectEvent be fired or not?

    What about checking the condition withing a DirectEvent handler and do some actions or do not?

    I mean to organize the things something like this.

    Example
    <%@ Page Language="C#" %>
     
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        protected void TestDirectEventHandler(object sender, DirectEventArgs e)
        {
            bool someCondition = true; //this is your judgement
    
            if (someCondition)
            {
                X.Msg.Alert("DirectEvent", "Hello from Server!").Show();
            }
        }
    </script>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Ext.NET Example</title>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            <ext:Button runat="server" Text="Test" OnDirectClick="TestDirectEventHandler" />
        </form>
    </body>
    </html>

Similar Threads

  1. [CLOSED] Question about event calls by combo box value.
    By rosua in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Jun 19, 2012, 11:53 AM
  2. [CLOSED] question about click event
    By rosua in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Mar 22, 2012, 7:07 AM
  3. [CLOSED] Question about Button Event Control
    By rosua in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Mar 22, 2012, 5:36 AM
  4. Replies: 4
    Last Post: Jun 30, 2011, 3:30 PM
  5. [CLOSED] Adding event to Calendar, Quick Question.
    By rbarr in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jun 28, 2011, 4:20 PM

Posting Permissions