[CLOSED] Page PostBack Query

  1. #1

    [CLOSED] Page PostBack Query

    Hi Danil,


    How Do I stop Page from getting PostBack whenever I use DirectEvent or DirectMethod. Please show some Example on this .
    Last edited by Daniil; Apr 04, 2013 at 11:55 AM. Reason: [CLOSED]
  2. #2
    Hi @vijay.sahu,

    Returning false from a DirectEvent's Before handler stops a request.

    Example 1
    <ext:Button runat="server" Text="Test">
        <DirectEvents>
            <Click OnEvent="TestDirectEventHandler" Before="return true || false;" />
        </DirectEvents>
    </ext:Button>
    Returning false from the same Listener also stops a request.

    Example 2
    <ext:Button runat="server" Text="Test">
        <Listeners>
            <Click Handler="return false;" />
        </Listeners>
        <DirectEvents>
            <Click OnEvent="TestDirectEventHandler" />
        </DirectEvents>
    </ext:Button>
  3. #3

    PostBack Query

    Hi Danil,

    I think the question posted initially was not clear enough.
    When we give a call to a Direct Method or a DirectEvent, it goes to Page_Load Event and there we check if the Page is PostBack or an AjaxRequest call or not by using IsPostBack or X.IsAjaxRequest properties.

    What I actually want is while firing any one of the above methods, it should not go to the Page_Load but instead it should directly go the Method or Event stated in the Page.


    Current behaviour
    Initial Load : page_load
    Click of a button having direct event/method : Page_Load -> DirectEvent/Method

    What I actually want is
    Initial Load : page_load
    Click of a button having direct event/method : DirectEvent/Method (It should directly go to that method rather than to have a call in page_load)



    Pls Provide your Inputs with sample code
  4. #4
    A static DirectMethod allows to achieve your requirement, see #4 here:
    https://examples2.ext.net/#/Events/D...hods/Overview/

    Please note that no Page lifecycle means no controls, i.e. you won't get an access to any controls.
  5. #5

    PostBack Query

    Thank You Danil.

    Eventually I got my solution to use static method or try for an ajax call.

    Thank You Danil

    You can close this thread

Similar Threads

  1. How to maintain page index after postback.
    By itskvini in forum 1.x Help
    Replies: 3
    Last Post: Jul 05, 2012, 1:27 PM
  2. [CLOSED] Cross-page Postback
    By alliedwallet.com in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Oct 16, 2011, 1:19 PM
  3. Ext control invisible after postback of page.
    By Rupesh in forum 1.x Help
    Replies: 7
    Last Post: Sep 17, 2010, 5:11 AM
  4. VB.NET Code Behind Page Postback Problem!
    By infastruct in forum 1.x Help
    Replies: 5
    Last Post: Dec 01, 2009, 1:58 AM
  5. [CLOSED] PostBack inside autoloaded page
    By Rod in forum 1.x Help
    Replies: 3
    Last Post: Sep 26, 2008, 6:40 AM

Posting Permissions