title: mvc EditorTemplate DisplayMod
body: <p>I'm creating a mobile website using MVC-4.</p>
  
  <p>Integer fields should be entered from the numeric keyboard, I use the EditorTemplate <code>number</code> wich creates an HTML element like this:</p>
  
  <pre><code>&lt;input ... type="number" value="45" /&gt;
  </code></pre>
  
  <p>My customer doesn’t much appreciate the numeric keyboard shown this way on his iPhone and has asked me to show the phone keyboard which is shown by using <code>type="tel"</code> instead of <code>type="number"</code>.</p>
  
  <p>I’m struggling as to how to accomplish this in my EditorTemplate <code>number.cshtml</code>.</p>
  
  <p>I’ve created a separate iPhone DisplayMode but am not sure how to use it combined with an EditorTemplate, I’ve tried copying it to <code>number.iPhone.cshtml</code> but EditorTemplates don’t seem to work that way… </p>
  
  <p>Is there some method to retrieve the current DisplayMode so I can solve this problem ?</p>
  
  <pre><code>// pseudo code I guess …
  
  @if(DisplayMode == "iPhone")    
  { 
     @Html.TextBox("", ViewData.TemplateInfo.FormattedModelValue, new { @class = "text-box single-line", type = "tel" })   
  }    
  else     
  {
     @Html.TextBox("", ViewData.TemplateInfo.FormattedModelValue, new { @class = "text-box single-line", type = "number" })
  }
  </code></pre>