I have a webpage that currently performs a small task before redirecting to a third-party site.
The redirection is initiated by using Response.Redirect();
Now, I am looking to integrate another function using JavaScript this time.
To add the JavaScript to the page, I am utilizing the following method:
if (!page.ClientScript.IsStartupScriptRegistered(key))
{
ScriptManager.RegisterStartupScript(page, typeof(Page), key, script, false);
}
The purpose of the JavaScript function is to track a sale, so it is essential for the page to render it and execute the tracking before proceeding further.
If anyone has insight on whether this approach will be successful or not, and if not, suggestions on how to achieve the desired outcome would be highly appreciated.