Opening External Websites from Server-Side C# Code Snippets in Infor CRM (Saleslogix) Web

If you need to open a new browser window or tab to an external website from a C# Code Snippet in Infor CRM (Saleslogix) Web, which is server-side code, you can easily create Javascript and add it to the page so it executes when the post back that fired the C# Snippet completes.

In the C# Snippet, add code like the following:

var script = "var win = window.open('http://google.com');";
ScriptManager.RegisterClientScriptBlock(this, GetType(), "OpenExternalWebsite", script, true);

This registers the javascript to open google.com in a new browser window/tab on the page. Now when the postback completes, the javascript will run and open the website. This sort of thing can especially come in handy when you need to do some server-side code and conditionally open the website based on some conditions.

ABOUT THE AUTHOR

Ryan Farley

Ryan Farley is the Director of Development for Customer FX and creator of slxdeveloper.com. He's been blogging regularly about SalesLogix since 2001 and believes in sharing with the community. He loves C#, Javascript, Python, web development, open source, and Linux. He also loves his hobby as an amateur filmmaker.

Submit a Comment

Your email address will not be published. Required fields are marked *

Subscribe To Our Newsletter

Join our mailing list to receive the latest Infor CRM (Saleslogix) news and product updates!

You have Successfully Subscribed!