Currency formatting different on different sites - asp.net

I have a weird issue here, and I'm not sure if its ASP.NET versions, IIS, or me doing something stupid (experience tells me its probably item 3.)
I have 2 websites that worked fine on w2k3, 1 is ASP.NET 1.1, and the other 2.0, with the currency being displayed correctly on web pages.
Since migrating these to a w2k8 box and IIS 7 I have an odd issue where the 1.1 site is now displaying $ rather than the local currency that the user browses to. But the 2.0 site works fine.
Both have IIS set to the same globalisation. (No culture, Client is false, UI Culture is English (en)).
Both sites are hosted on the same server, the only differences I can see are that;
1 binds using <Databinder.Eval(... Price, "{0:c}")> and the other binds to a property that uses String.Format("{0:c}");
So being as the code has not changed I feel that it is an IIS issue. But as both sites have the same globalisation settings in IIS I don't see that it can be.
So, anyone know whats goign on and how to solve it?

Running IIS 10 site that was developed on a UK machine server 2012 was moved to a GCP default build server 2016 which comes US "out of the box".
On the website $ signs appear where £ signs used to.
I changed everything I could in Settings > Region and Language. UK language, keyboard, Update & Security, Drive on Left etc. Absolutely nothing made any difference.
Finally found it in Control Panel > Region. After adding English UK as a display language (and gettting rid of US English)
I needed to go to Adminstrative Tab, Welcome Screen and new User Accounts. Copy the settings.
Now the site is finally displaying correct currency symbol.

Check the Regional and Language options from control panel on the new server and make sure they match the like setting on the old box.

AFAIK, at least String.Format("{0:c}") and probably <Databinder.Eval(... Price, "{0:c}")> as well will use whatever the value of property System.Threading.Thread.CurrentCulture is.
It does not matter whether or not you set it on the page, the value will be assigned to it anyway. And it is pretty reasonable to think, that these settings will come from server settings, which from your description seems to be en-US. Thus $ as currency sign... You might ask yourself why it was working before...
Well, are you sure that you have copied all the configuration files?
Another clue might be, that you have emulated version of .Net 1.1 rather than the real one on your new box. It might be not 100% compatible...

Related

Umbraco dictionary translations are not working correctly on localhost

I have downloaded an Umbraco 6 site and I have tried replicating the environment locally in my machine, using the production database and the compiled site from production.
If I go to the Umbraco backoffce and to the Settings => Dictionary entries, I can see a specific dictionary entry in multiple languages.
This entry is displayed correctly in production when the user chooses a different language. However, locally, when I change the language, the dictionary item still appears in english (the default language and does not get translated).
I have tried running the site through Visual Studio and WebMatrix, to check if this was some issue with the webserver settings locally, as this might be session related, but the issue still happens.
Is there a reason why translation for dictionary items is not working as expected? Content that is created through nodes and translated there is showing up in the correct language, but dictionary items are not.
UPDATE
I am now looking into something that could be responsible for this. When I am at the content area and select one of the language nodes and head to properties, I see multiple "Alternative links", which contain URLs to the same page on different domains. I don't see localhost:XXXX/EN.aspx there, which makes me wonder as to whether or not the site is handling the language detection correctly in localhost. I haven't found how to add additional links there, and be able to use a wildcard for port would be interesting.
You should right click on the node - select "Culture and Hostnames" and add your domain there.
After that right click on the root "Content" node and click on "Republish entire site" - that should clear the cache and you should be able to see the new url under "Alternative links".

Caching issue causes site goes to IIS splash page

My company creates sub-domains for our customers that sign up with us. For the longest time now, we'd create the site (for example https://foo.domainname.com), and it would go directly to the application. However recently, after creating a site when you go to navigate to it, it just shows the IIS 7 Splash page. After doing a bit of Googling, I found this thread, and it appears to be the case, because when you go to the main page directly, instead of the root, it works. Then after that the root works as expected.
It's great we have a way to help our customers now, however telling our customers to clear their cache and/or navigate to the main page directly is not ideal for many obvious reasons. So considering this is a new behavior, it seems safe to assume something is not working quite right. How do I go about fixing this, because I am stumped.
iis is also set to "application pool" of the sites.
Create and set new "application pool" sites. Thus, they work more efficiently.
https://docs.kentico.com/k11/installation/deploying-kentico-to-a-live-server/creating-virtual-directories-and-application-pools-in-iis-7-5-and-7-0

Safe to allow double escaping on IIS

I have a site that is using IIS 7.5 it is also using ISAPI rewrite. I would like to redirect some URLS that will be passed by a piece of desktop software one of our business partners use. Basically they have an app that can be used to look up product, they can click on a product in the app and be take to the supplier's web site.
The problem is the app, which is used by many customers and cannot be changed to accommodate me, uses a "+" to eliminate spaces in some of the URL parameters. This is causing problems because I am trying to use ISAPI rewrite to re-write the URL based on the part number. The "+" sign causes IIS to return a "not found" error.
According to everything I have read this can be fixed by allowing double escaping in the web.config file. Everyone seems pretty cavalier about allowing this, but I see MS considers it a security issue.
So what exactly is the danger of allowing double escaping? We have an asp classic site running on this server so I don't want to risk any exposure of the site or DB by using this. OTOH if I could feel confident allowing it, it would be a really easy way to solve a problem.
That's a complex question. I don't have OTOH for you, but I can tell you that in the last 4 years of my experience with IIS and double-escaping, our customers have been enabling double escaping without any further problems. Member of HeliconTech Support Team

ASP Pages Running on IIS7 But Not Pulling Include Files

We're working on upgrading our site from Server 2003 running IIS6 to Server 2008 R2 running IIS7. We've been able to work through most issues thus far but have encountered one that has us stumped: .ASP pages aren't pulling in the include file that's being referenced. Here's an example:
virtual="/scripts_path.asp" -->
This is preventing our site's main menu from being pulled in. Based on what I've read on these "Interwebz," the frequent causes of this problem are ASP not being installed and ASP Parent Paths not being enabled. Unfortunately, ASP is installed and parent paths are enabled.
There have been some semi-similar questions posted here on SO but, regrettably, haven't been answered completely or just weren't relevant.
Anyone ever encountered something similar?
Now, if you'll excuse me, I'm going to go drown my sorrows... with a plate full of brownies.
try using path="C:\some\path" instead. The virtual to physical mapper is sometimes disabled. (server.mappath for example)
also the real example would be good to have.

IIS VS 2008 / Web.config - wrong date format

can anyone help. I have recently moved servers, its IIS7 rather that our previous IIS6 but everything else is the same, i have set the region to the UK and all date formats plus system local .. I mean everything ..
But when a webpage asp.net is running on IIS7 it thinks the dates are another format..
This is really puzzling .. i did manage to fix it by putting in each web.config
<globalization culture="en-GB"/>
but i have to put it in everyone.. I know i can aslo put it in machine.config.
But i don't understand it, my other server works without modifications. I have checked the web.config and the machine.config on my old server and it has none of these additions
Any ideas?
Thanks
Make sure you have also ticked the box in Regional and Language Options (Advanced tab) to say "Apply all settings to the default user profile. The account that .Net runs under will remain as US unless you do this. Reboot.
Been there :)
Check the localization options on the box and see what it is set for--someone probably just selected en-US for the setup and forgot to tell anyone.

Resources