Quantcast
Channel: ASPRunner forums
Viewing all articles
Browse latest Browse all 2586

Another issue with ViewControl.Format (custom formatting)

$
0
0
Should ViewControl.Format work when selecting "Custom" and inserting custom code in the View as tab? If so, I have uncovered another bug in this implementation.

I have two time fields. The standard Time format doesn't work for me because I don't want to display seconds. So I went with custom and used this code:


if (data["EndTime"]  != null)
	{
		value = String.Format("{0:h:mm tt}", Convert.ToDateTime((string)data["EndTime"]));
	}
else
	{
		value = "";
	}



This works perfectly on all display pages, but when using ViewControl.Format to apply this formatting in an email from an update page, I get the raw time value in the email. This only applies to the custom formatting, not the built-in Time format. The other time Field, for which I selected the standard Time format as an A/B test, formats as expected in the email using ViewControl.Format:

  • Date: 10/18/2019
  • Time: 6:00:00 PM
  • End time: 19:00:00

Viewing all articles
Browse latest Browse all 2586

Trending Articles