I have a model...
public class PatientACOModel
{
public int EncounterId { get; set; }
public int PatientId { get; set; }
public int EMPIID { get; set; }
public int PopulationPatientID { get; set; }
public string EditAddOrEditCurrent { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public DateTime? DateOfBirth { get; set; }
//[UIHint("_PhoneNumFormatter")]
public string Phone { get; set; }
}
I want to specifically format my phone numbers. I just want to put a UIHint over my phone number and possibly other phone numbers. I don't want all strings to be formatted.
I am trying things like this...
@Model String
@if (Model != null) {
String.Format("{0: (###) ###-####}", double.Parse(Model.ModelMetadata.Get));
}
That would be the display template referenced in my UIHint that is commented out. When I do that, none of my strings show up. What am I doing wrong?
In my display template how do I get the string to parse and then Format?