防止跨请求的全球化文化变化

Prevent globalization culture changes across request

我遇到日期未从字符串转换的问题。

public dsBookingActual GetBookingActualData(Int64 ozBookingID, string consultant, string screenViewed)
{
            DbCommand dbCommand = db.GetStoredProcCommand("usp_GetBookingActualData");
            db.AddInParameter(dbCommand, "@OzBookingID", DbType.Int64, ozBookingID);
            db.AddInParameter(dbCommand, "@Consultant", DbType.String, consultant);
            db.AddInParameter(dbCommand, "@ScreenViewed", DbType.String, screenViewed);

            dsBookingActual dsBA = new dsBookingActual();
            //LoadDataSet fails when the date is 29/01/2016
            db.LoadDataSet(dbCommand, dsBA, new string[] { Constant.BOOKING_ACTUAL, "Passengers" });
            return dsBA;
}

我们在澳大利亚,因此日期格式为 dd/mm/yyyy,转换日期 29/01/2016 失败,因为它正在尝试转换为 mm/dd/yyyy,例如 29 不是有效月份。

我追踪到浏览器中的语言设置设置为美国,类似于 this post

我们在 system.web 中有一个全球化标签:

<globalization culture="en-AU" requestEncoding="utf-8" responseEncoding="utf-8" uiCulture="en-AU" />

所以我的问题是如何防止文化在请求中发生变化。我猜它不涉及确认或处理 "Accept-Language header in the HTTP Request" 但我不确定如何实现它。

感谢任何指点。

事实证明,这个问题是我们使用 ASP Boilerplate 的结果。框架没有问题,是我们对它的使用导致了问题。