Help Required on WebApplicationAdapter

Hi There,

Can you please provide samples on BeforNavigate() & DoAction() Events?

Should this work?

publicoverridebool BeforeNavigate(refstring app,refstring action,refstring data,refint flags,refstring headers,refstring url,refobject postData)

{

if(url.Contains("Alerts.aspx"))

{

url =http://www.microsoft.com;

// OR Browser.Navigate("http://www.microsoft.com");

}

}

How should I cancel the default action so that the current application does navigate to microsoft site instead of the URL specified in the default action.

Also the URL and Path attributes of action are READ ONLY, so can't change the querystring or url whenever required.Browser.Navigate() does not work hereSad anddata ="<ApplicationData>" + somedata + "</ApplicationData>";adds to the querystring but does not change it.

Please Help!!

[2879 byte] By [SupriyaAdmulwar] at [2008-2-19]
# 1

What you can do, assuming your URL is coming from the Action itself is capture the action event with DoAction and encode the URL data coming going to the Browser..
EX:

public override bool DoAction(Microsoft.Ccf.Csr.HostedWebApplication.WebAction action, ref string data)

{

data = System.Web.HttpUtility.UrlEncode(data);

return base.DoAction (action, ref data);

}

let me know if that works for you..

thanks !

Mattb -MS

MattB-MSFT at 2007-9-12 > top of Msdn Tech,Customer Care Framework,Customer Care Framework...
# 2

thnx Matt!!

But its not working

i am trying a simple thing.......before i start a session with a customer all i know is its customer id and ticket id of the complaint logged by tht customer.

So when i start the session, i want the ViewTicket.aspx page, which displays the ticket history of that customer, to naviagate to the specific ticket when it loads (say CreateNewTicket.aspx?ticketid=23&customerid=1).

How can i achieve this?

SupriyaAdmulwar at 2007-9-12 > top of Msdn Tech,Customer Care Framework,Customer Care Framework...
# 3

Hi Supriya and Matt.

I wanted a similar thing to be done. Obtain customer id and account no from context and append it to the login url in a querystring. I tried doing that in BeforenavigateUrl like Supriya but it did not work.

Also, the local object _context that I created and that gets set in NOtifycontextChange was null in BeforenavigateUrl method since this is called before NotifyContextChange. So I dont know how to obtain the context values in the BeforeNavigateUrl.

Could someone help me with this.

Thanks in advance.

AnamikaDas at 2007-9-12 > top of Msdn Tech,Customer Care Framework,Customer Care Framework...
# 4

Anamika, I have tried implementing this. Actually, we can get/set the current context only in the NotifyContextChange event and nowhere else. Alternatively, you can set values of hidden controls and fire an event on it's value change event so that you can redirect your page accordingly. But, what I observed that this value/text_change event is not getting fired .

Let me know if you find any other solution for this.

Thank you!

SupriyaAdmulwar at 2007-9-12 > top of Msdn Tech,Customer Care Framework,Customer Care Framework...
# 5

Hi Supriya,

The hidden controls will be there in the application to which I have no access, so I cant do as you have written Sad ..

Apart from this were you able to redirect your page in Beforenavigate. I tried changing the url and also tried browser.navigate but it simply does not get redirected. If you know something about this please do help.

If I get the solution I'll post it here...

Thanks..

Anamika

AnamikaDas at 2007-9-12 > top of Msdn Tech,Customer Care Framework,Customer Care Framework...
# 6

Hey that is the problem I am facing and that is the reason I have posted this query.

One more way out is that, you can have your context updated every time session changes and have your application as non-global.

In your application page load event, you can always redirect to to a new page with thecontext values you get in the querystring. But the disadvantage is that you can do it ONLY when a session loads and not after that.

Let me know if it works for you.....

SupriyaAdmulwar at 2007-9-12 > top of Msdn Tech,Customer Care Framework,Customer Care Framework...