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 ='');";
ScriptManager.RegisterClientScriptBlock(this, GetType(), "OpenExternalWebsite", script, true);

This registers the javascript to open 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.

Want content like this delivered to your inbox? Sign up for our newsletter!

Ryan Farley

Ryan Farley is the Director of Development for Customer FX and creator of He's been blogging regularly about SalesLogix, now Infor CRM, since 2001 and believes in sharing with the community. His new passion for CRM is Creatio, formerly bpm'online. He loves C#, Javascript, 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 *