Note that there are some explanatory texts on larger screens.

plurals
  1. POFormat a date in label regardless of culture
    text
    copied!<p>In my ascx page i have : </p> <pre><code> &lt;tr&gt; &lt;td class="lbl"&gt;Geboortedatum&lt;/td&gt; &lt;td class="lbl"&gt;:&lt;/td&gt; &lt;td class="data"&gt; &lt;asp:Label ID="tbBirthDate" CssClass="details" runat="server" /&gt; &lt;/td&gt; &lt;/tr&gt; </code></pre> <p>This Birtdate is filled from the cs file :</p> <pre><code> var cust = (from c in db.tbCustomers join s in db.tbStreets on new { c.StreetId, c.PostCode } equals new { s.StreetId, s.PostCode } join p in db.tbPostalAreas on s.PostCode equals p.PostCode where c.Id == customerId select new { FirstNames = c.FirstNames, MiddleName = c.MiddleName, LastName = c.LastName, BirthDate = string.Format("{0:dd-mm-yyyy}", c.BirthDate.Value.ToShortDateString()), StreetName = s.Street, HouseNumber = c.HouseNumber, PostCode = c.PostCode, PostCodeLetters = c.StreetId, City = p.City, Email = c.Email, Mobile = c.PhoneMobile, PickUpAddress = c.PickupAddress }).SingleOrDefault(); if (cust != null) { tbFirstName.Text = cust.FirstNames; tbLastName.Text = (cust.MiddleName != null) ? cust.MiddleName + " " + cust.LastName : cust.LastName; tbBirthDate.Text = cust.BirthDate; tbStreetName.Text = cust.StreetName + " " + cust.HouseNumber; tbPostCode.Text = cust.PostCode + " " + cust.PostCodeLetters; tbCity.Text = cust.City; tbEmail.Text = cust.Email; tbMobile.Text = cust.Mobile; tbPickupAddress.Text = cust.PickUpAddress; } </code></pre> <p>Now when running locally i get a date like 26-10-2011, but when placed on my server i get 10/26/2011 How can i force the date to be shown as 26-10-2011 ?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload