[CLOSED] Difference between DirectMethod , DirectEvent, Static DirectMethod

  1. #1

    [CLOSED] Difference between DirectMethod , DirectEvent, Static DirectMethod


    Could you explain us what is the difference between DirectMethod, DirectEvent and Static DirectMethod in very detail, what event's fires in the page life cycle each one, etc... it is important because I use StateServer session management and I found when I use DirectMethod the ReleaseRequestState event don't fire.

    Thanks for help.
    Last edited by Daniil; Mar 07, 2011 at 9:14 PM. Reason: [CLOSED]
  2. #2

    - DirectEvent: server side handler for client side event of particular widget. Widget server side instance must be exist on server side (otherwise ResourceManager will not able to find handler)

    By default, DirectEvent submits whole form (including ViewState if presented) therefore all widgets get values from submit and page executes full life cycle (IsPostBack will be true). You can this behaviour by setting Type="Load" for DirectEvent. In this case, ExtraParams only will be submitted

    - DirectMethod (none static, must be public): server side handler is raised when you call special javascript method (basically, proxy method is generated by Ext.Net toolkit). None static direct method can be defined inside Page, User Control or any Custom Control. Please note, if direct method is defined inside user control (master page placeholders are user controls also) or custom control then ClientID of that control will be added to proxy method
    You can use DirectMethodProxyID attribute for the class to define own alias or completely remove ClientID prefix
    Really, none static direct method is direct event. Single difference, that direct method has no relation with any widget (and its events) and can be raised by developer from javascript (as javascript method)

    - Static DirectMethod (must be public): similar ASP.NET PageMethods, can be defined inside Page class only. With static page method the Page life cyle is not execued therefore access to ASP.NET control is not possible but response time much better (depends from your method logic only)

    Vladimir Shcheglov
    Sr. Developer

Similar Threads

  1. [CLOSED] DirectEvent & DirectMethod
    By trieu.tran in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: May 31, 2012, 11:47 AM
  2. [CLOSED] Calling Static DirectMethod defined in an UserControl
    By ISI in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Aug 05, 2011, 9:16 AM
  3. Replies: 13
    Last Post: May 16, 2011, 1:26 PM
  4. [CLOSED] DirectEvent or static DirectMethod?
    By macap in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Nov 23, 2010, 12:31 PM
  5. [CLOSED] Static DirectMethod
    By amitpareek in forum 1.x Legacy Premium Help
    Replies: 21
    Last Post: Jun 03, 2010, 12:42 AM

Tags for this Thread

Posting Permissions