none
Problem with firing action. RRS feed

  • Question

  •  

    Hi,

     

    I have hosted a web application and I am using Legacy Adapter for that. I am implementing the DoAction method. Now this web application has a button, and I want to automate its click event. So I am firing an action from another application and I am implementing the logic in the DoAction method.

    Now the problem is that this button click takes this application to a different URL (say from http://test.aspx to http://test1.aspx ). Now while configuring the Action for a web application we need to give the URL. I have given the URL as http://test.aspx . But the problem is that the action is appending some query string to this URL ( http://text.aspx?_ccfdata=<root> </root> ) and it is not redirecting to the page http://test1.aspx , instead the page  http://test.aspx gets called again. I have selected the method as GET. Kindly help me to understand what is the problem.......

     

    Tuesday, January 22, 2008 10:48 AM

Answers

  • If your in a web application adapter, the default behavior of DoAction is to perform a navigate function…

    If your using the action to trigger an event / behavior in the application ( a button click for example. ) then you just need to return “false” from the DoAction method.  That will cause CCF to stop processing the Navigate command.

    For example:

     

    Code Snippet

    public override bool DoAction(HostedWebApplication.WebAction action, ref string data)
    {

        if ( action.name.Equals("ClickBtn") )

        {

            DoButtonClick(); /// Do my event work.
            return false;   /// Stops processing the DoAction here. 

        }

     

        return base.DoAction(action, ref data);

    }

     

     

    In this scenario, the action ClickBtn, is configured with the URL called about:blank.

     

    MattB -MSFT

    Wednesday, April 23, 2008 5:35 AM
    Moderator

All replies

  • Roy:

     

    Have you managed to fix your problem? I am having the same issue. What the point of redirecting to a new url if all you want is to click a control on the existing webpage?

    Wednesday, April 23, 2008 4:51 AM
  • If your in a web application adapter, the default behavior of DoAction is to perform a navigate function…

    If your using the action to trigger an event / behavior in the application ( a button click for example. ) then you just need to return “false” from the DoAction method.  That will cause CCF to stop processing the Navigate command.

    For example:

     

    Code Snippet

    public override bool DoAction(HostedWebApplication.WebAction action, ref string data)
    {

        if ( action.name.Equals("ClickBtn") )

        {

            DoButtonClick(); /// Do my event work.
            return false;   /// Stops processing the DoAction here. 

        }

     

        return base.DoAction(action, ref data);

    }

     

     

    In this scenario, the action ClickBtn, is configured with the URL called about:blank.

     

    MattB -MSFT

    Wednesday, April 23, 2008 5:35 AM
    Moderator
  • MattB:

     

    It does work. Thanks! Funny, I have tried the "return false" before I post and it does not work then. May be the "about:blank" does it.

     

    Thanks again.
    Wednesday, April 23, 2008 6:46 AM