I ran into a browser-specific error when trying to redirect to DHL tracking site from my app
I have this key in the AppSettings
in my web.config
file
<add key ="DHL" value="http://www.dhl.com/en/express/tracking.html?AWB={tracking_number}"
I also have a HyperLink
Control like this
<asp:HyperLink id="hlink" runat="server" Target="_blank">
</asp:HyperLink>
Then I set the value in code behind:
hlink.NavigateUrl = String.Format(System.Configuration.ConfigurationManager.AppSettings["DHL"], myClass.TrackingNumber)
When the I click on the url and gets redirect to the site, when the page loads, a Webpage error window popped up with following message:
The value of the property dcsMultiTrack is null or undefined, not a Function Object
If I just ignore the message and hit "no" to the error window, the site will continue to load just fine. However, it is really ugly that everytime I get redirect to DHL the error shows up.
This only happens to IE, I tested with Edge and it was fine. Also,this function is not from my code, but from DHL's site. So I am not sure if there is anything I can do about it. Any suggestions will be appreciated.
I think this may have to do with the url am I using, is this URL out of date? what would be a good URL to redirect to DHL?
It turns out that this is the legacy DHL tracking site. For anyone who needs to use similar functionality, use the new URL instead:
https://www.dhl.com/us-en/home/tracking/tracking-express.html?submit=1&tracking-id={0}