Problem in raising direct methods in usercontrol

  1. #1

    Problem in raising direct methods in usercontrol

    Hi,


    Anyone can please help me in getting through my problem of solving ext.net task..


    I need to raise directmethods from usercontrols in ext.net as i have a huge code which i can only put up in asc.cs rather than .ascx direct events

    and i need to call this page in .aspx.

    My task is..

    I need to get the records from the database and display in panels as 20 per page, which is placed in placeholder.This is to be displayed in .aspx page layout.Each panel i used is usercontrol which contains each record as upper panel and corresponding lower panel is hidden by default.The upper panel contains a gridpanel whose each row contains edit button,onclick of edit button in corresponding upper panel i am capturing rowid and automatically lower panel of the record is opened by populating data of that rowid.The panel, gridpanel ,edit button all are in usercontrol.Once the lower panel is opened i need to do some operations and populate date again to that row in gridpanel in the upper panel.I had edit, delete,cancel methods in usercontrols.I had huge code to that so i require to raise directmethods which is quite comfortable than directevents in script.But i couldnt raise directmethods.Is there any alternative to raise listeners to the usercontrols?
    Please Guide me if possible...If u r not clear, let me know i will be more clear.

    Regards,
    Lavanya
  2. #2
    https://examples2.ext.net/#/Events/DirectMethods/UserControls/

    There are two examples on the page above. One deals with a user control calling its own DirectMethod; the second shows how to call the method from the parent page.

    I am personally familiar with this pattern, which is not used on the example:
    App.direct.Foo();
    App.direct.UserControl1.Bar();
    You can also override the attachment of the client proxy using the IDMode parameter of the DirectMethod attribute:
    [DirectMethod(IDMode = DirectMethodProxyIDMode.None)]
    public string Bar() {}
    This will append your user control's client side method proxies to the App.direct object:

    App.direct.Bar();
  3. #3
    Hello!

    Have you tried this example https://examples2.ext.net/#/Events/D.../UserControls/ ?

    If it doesn't work for you can you post example of your problem?
  4. #4

    Thank u for the response

    Quote Originally Posted by Baidaly View Post
    Hello!

    Have you tried this example https://examples2.ext.net/#/Events/D.../UserControls/ ?

    If it doesn't work for you can you post example of your problem?

    Hi,

    I had gone through the link but that is not my requirement.I had huge coding which i want to do it from ascx.cs as direct methods not as direct events in .ascx.I will more clearly post my issue.

    Regards,

    Lavanya
  5. #5

    Thank u for the response

    Quote Originally Posted by jwf View Post
    https://examples2.ext.net/#/Events/DirectMethods/UserControls/

    There are two examples on the page above. One deals with a user control calling its own DirectMethod; the second shows how to call the method from the parent page.

    I am personally familiar with this pattern, which is not used on the example:
    App.direct.Foo();
    App.direct.UserControl1.Bar();
    You can also override the attachment of the client proxy using the IDMode parameter of the DirectMethod attribute:
    [DirectMethod(IDMode = DirectMethodProxyIDMode.None)]
    public string Bar() {}
    This will append your user control's client side method proxies to the App.direct object:

    App.direct.Bar();
    Hi,

    Could i achieve my solution for the problem through ascx.cs as i had huge coding.So i want to raise direct methods than direct events in .ascx. Hope u got it.Else,pls let me know.


    Regards,
    Lavanya
  6. #6
    Last edited by Baidaly; Nov 16, 2012 at 1:16 AM.

Similar Threads

  1. Direct Methods and Custom Control
    By Zdenek in forum 1.x Help
    Replies: 0
    Last Post: Apr 19, 2012, 10:18 PM
  2. Replies: 6
    Last Post: Nov 30, 2011, 6:48 PM
  3. [CLOSED] Common Direct Methods
    By speedstepmem3 in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Nov 25, 2011, 5:54 AM
  4. Are direct methods same as WebMethod
    By deeptechtons in forum 1.x Help
    Replies: 2
    Last Post: Dec 27, 2010, 3:31 AM
  5. [CLOSED] how to pass combobox values through direct methods
    By dev in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Sep 08, 2010, 3:54 AM

Posting Permissions