c# - DataAnnotation Presentation Working on IIS Express but Not Working on IIS -
i'm developing asp.net mvc application, , controlling presentation of element properties using data annotations. result fine on iis express directly visual studio, when deploy uat server annotations fail.
code:
edit.cshtml:
@html.editorfor(m => m.globalizedelement)
model:
public class globalizedelement { [hiddeninput(displayvalue = false)] public int id { get; set; } [hiddeninput(displayvalue = false)] public int elementid { get; set; } [hiddeninput(displayvalue = false)] public string culturecode { get; set; } [datatype(datatype.multilinetext)] [allowhtml] [display(name = "internaldescription", resourcetype = typeof(entitydataannotations))] [required(errormessageresourcetype = typeof(entityvalidation), errormessageresourcename = "requiredinternaldescription")] public string internaldescription { get; set; } [datatype(datatype.multilinetext)] [allowhtml] [display(name = "interviewdescription", resourcetype = typeof(entitydataannotations))] public string interviewdescription { get; set; } [datatype(datatype.multilinetext)] [allowhtml] [display(name = "externaldescription", resourcetype = typeof(entitydataannotations))] public string externaldescription { get; set; } }
the iis express presentation hides hidden fields, , uses multiline text boxes.
the deployed iis presentation shows fields, , single line text boxes.
i using vs2013 on windows 7 ultimate, , deploying windows server 2008 r2 server.
thanks in advance assistance.
ricardo - no there no script elements on form. problem seems in rendering engine. page source iis express server is:
<div class="editor-field"> <textarea class="text-box multi-line" data-val="true" data-val-required="please enter a internal description" id="globalizedelement_internaldescription" name="globalizedelement.internaldescription"> </textarea> <span class="field-validation-valid" data-valmsg-for="globalizedelement.internaldescription" data-valmsg-replace="true"></span></div> <div class="editor-label"> <label for="globalizedelement_interviewdescription">interview description</label> </div> <div class="editor-field"> <textarea class="text-box multi-line" id="globalizedelement_interviewdescription" name="globalizedelement.interviewdescription"> </textarea> <span class="field-validation-valid" data-valmsg-for="globalizedelement.interviewdescription" data-valmsg-replace="true"></span></div> <div class="editor-label"> <label for="globalizedelement_externaldescription">external description</label> </div> iis is: <div class="editor-label"> <label for="globalizedelement_id">id</label> </div> <div class="editor-field"> <input class="text-box single-line" data-val="true" data-val-number="the field id must be a number." data-val-required="the id field is required." id="globalizedelement_id" name="globalizedelement.id" type="number" value="0" /> <span class="field-validation-valid" data-valmsg-for="globalizedelement.id" data-valmsg-replace="true"></span></div> <div class="editor-label"> <label for="globalizedelement_elementid">elementid</label> </div> <div class="editor-field"> <input class="text-box single-line" data-val="true" data-val-number="the field elementid must be a number." data-val-required="the elementid field is required." id="globalizedelement_elementid" name="globalizedelement.elementid" type="number" value="0" /> <span class="field-validation-valid" data-valmsg-for="globalizedelement.elementid" data-valmsg-replace="true"></span></div> <div class="editor-label"> <label for="globalizedelement_culturecode">culturecode</label> </div> <div class="editor-field"> <input class="text-box single-line" id="globalizedelement_culturecode" name="globalizedelement.culturecode" type="text" value="" /> <span class="field-validation-valid" data-valmsg-for="globalizedelement.culturecode" data-valmsg-replace="true"></span></div> <div class="editor-label"> <label for="globalizedelement_internaldescription">internaldescription</label> </div> <div class="editor-field"> <input class="text-box single-line" id="globalizedelement_internaldescription" name="globalizedelement.internaldescription" type="text" value="" /> <span class="field-validation-valid" data-valmsg-for="globalizedelement.internaldescription" data-valmsg-replace="true"></span></div> <div class="editor-label"> <label for="globalizedelement_interviewdescription">interviewdescription</label> </div> <div class="editor-field"> <input class="text-box single-line" id="globalizedelement_interviewdescription" name="globalizedelement.interviewdescription" type="text" value="" /> <span class="field-validation-valid" data-valmsg-for="globalizedelement.interviewdescription" data-valmsg-replace="true"></span></div> <div class="editor-label"> <label for="globalizedelement_externaldescription">externaldescription</label> </div> <div class="editor-field"> <input class="text-box single-line" id="globalizedelement_externaldescription" name="globalizedelement.externaldescription" type="text" value="" /> <span class="field-validation-valid" data-valmsg-for="globalizedelement.externaldescription" data-valmsg-replace="true"></span></div>
Comments
Post a Comment