Notifications
Announcements
No record found.
HI All,
I have a Custom Hosted Control, i have a requirement to open URL from C# Custom Hosted Control, Could any one help me here?
*This post is locked for comments
Hi Ram Prakash,
This article lists the supported methods for opening a URL in Unified Service Desk (USD).
Dear Adrian,
I would need to use C# Custom Hosted control to achieve this, do you have any code regarding this ?
Try this C# function.
public static void GoToUrl(string url) { System.Diagnostics.Process.Start(url); }
Thanks Adrian for your reply, the Code which you have sent is opening in different page in IE, i need to open it up with in USD, can you please share me the same..
Follow the below steps
1. Create an action with the following details
* Hosted Control : <<Hosted Control to open>>
* Action: Navigate
* Data = url=[[url]]
2. Call this action from your C# code
Context globalContext = localSessionManager.GlobalSession.AppHost.GetContext(); globalContext["url"] = <<URL to pass>>; localSessionManager.GlobalSession.AppHost.SetContext(globalContext); FireRequestAction(new RequestActionEventArgs("*", "GlobalContextChange", globalContext));
Please let me know if you need any further details
The correct way of doing it is - Expose an Event to your Custom Hosted control (some thing like OpenURL), in your C# use FireEvent() method to fire this event. In your Configurations, add this event and add an Action call to it to open the Actual URL (in it's respective hosted control). This is [tag:theway] of doing things in USD :)
Yes, exactly. This would be the best practice to implement this. If you want to follow the route Srikanth has mentioned, below is the detailed procedure to do the same
1. Create an Event in USD
• Hosted Control = <<Name of the Custom Hosted Control>>
• Create an Action >> Hosted Control => <<Destination Hosted Control>>, Action => Navigate, data=> url=[[navigateurl]+], Associate this action to the event.
2. Call this event from Custom Hosted Control
Below is the code to call the Event created from C# custom hosted control
• var eventParameters = new Dictionary<string, string> { { " navigateurl", <<url from code>>} };
FireEvent("<<Name of event created above>>", eventParameters);
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
SA-08121319-0 4
Calum MacFarlane 4
Alex Fun Wei Jie 2