[CLOSED] ext.net Button 'DirectEvent' on getting fired. Post back not happening on ext.net button click.

  1. #1

    [CLOSED] ext.net Button 'DirectEvent' on getting fired. Post back not happening on ext.net button click.

    Last edited by Daniil; Dec 21, 2012 at 4:55 AM. Reason: [CLOSED]
  2. #2
    Hi,

    - AutoPostBack requires '<form runat="server"'
    - Do not define OnDirectClick and AutoPostBack for one button because direct click handler will not be executed correclty due page hard reloading (postback)
    - To handle postback use OnClick handler
    - If you use ASP.NET MVC then do not use server side handlers inside views, use controller actions for that
  3. #3

    There is some issue with server post back handler? Am I missing something?

    [QUOTE=Vladimir;98724]Hi,

    - AutoPostBack requires '<form runat="server"'

    - Do not define OnDirectClick and AutoPostBack for one button because direct click handler will not be executed correclty due page hard reloading (postback)- I had put AutoPostBack for trying. keeping only OnDirectClick don't work.

    - To handle postback use OnClick handler - Using OnClick also don't seem to work

    - If you use ASP.NET MVC then do not use server side handlers inside views, use controller actions for that - On this button click, I need value from a text box which is not binded to model. This text box is only for taking input. How I am suppose to take this text box value directly in controller method?
  4. #4
    Hi @alscg,

    Please use [QUOTE] tags to wrap quotes.

    Regarding the problem.

    Please refer a controller action via URL and pass a required data via ExtraParams.

    Example View
    <!DOCTYPE html>
    
    <html>
    <head>
        <title>Ext.Net.MVC v2 Example</title>    
    </head>
    <body>
        @Html.X().ResourceManager()
    
        @(Html.X().Button()
            .Text("DirectEvent")
            .DirectEvents(de =>
            {
                de.Click.Url = Url.Action("TestDirectEvent");
                de.Click.ExtraParams.Add(new { test = "Hello!"});
            })
        )
    </body>
    </html>
    Example Action
    public ActionResult TestDirectEvent(string test)
    {
        X.Msg.Alert("Server", test).Show();
    
        return this.Direct();
    }
    Also you can use a DirectMethod, see #3:
    http://mvc.ext.net/#/Events/DirectMethod/
  5. #5

    Form Button Direct Event return view

    "
    Example Action
    public ActionResult TestDirectEvent(string test)
    {
        X.Msg.Alert("Server", test).Show();
    
        return this.Direct();
    }
    "


    Hi Danil,


    In the above action you mentioned this.Direct() but i am unable to get this method or view. Its showing an error that no extension method is written.

    I am using Ext.net 2.0 and MVC4.

    Could you please provide a solution to resolve this.

    Thanks & Regards,
    Chinni
  6. #6
    Hi @chinninani,

    Please clarify what Ext.NET version are you using?

    Is there the following in the controller?
    using Ext.Net.MVC;
  7. #7
    Hi Daniil,

    Thanks for your response. Now i am able to get the result.

    I added that using statement. :-)

    Regards,
    Chinni

Similar Threads

  1. Replies: 19
    Last Post: Apr 26, 2016, 9:56 PM
  2. Replies: 5
    Last Post: Mar 19, 2014, 3:35 AM
  3. Replies: 6
    Last Post: Jan 08, 2012, 4:06 AM
  4. [CLOSED] Button CLICK directevent & listener timeout
    By webclouder in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Apr 05, 2011, 10:10 PM
  5. Replies: 2
    Last Post: Oct 22, 2010, 11:04 AM

Posting Permissions