The advantages of EditorFor
is that your code is not tied to an <input type="text"
. So if you decide to change something to the aspect of how your textboxes are rendered like wrapping them in a div
you could simply write a custom editor template (~/Views/Shared/EditorTemplates/string.cshtml
) and all your textboxes in your application will automatically benefit from this change whereas if you have hardcoded Html.TextBoxFor
you will have to modify it everywhere. You could also use Data Annotations to control the way this is rendered.
Related Posts:
- What is the @Html.DisplayFor syntax for?
- how to call jquery selector from outside kendo window?
- A potentially dangerous Request.Form value was detected from the client
- How to remove error about glyphicons-halflings-regular.woff2 not found
- What is ViewModel in MVC?
- Can’t Add View from Controller in VS 2015 : “There was an error running the selected code generator”
- What is the difference between ASP.NET and ASP.NET MVC?
- The following sections have been defined but have not been rendered for the layout page “~/Views/Shared/_Layout.cshtml”: “Scripts”
- The following sections have been defined but have not been rendered for the layout page “~/Views/Shared/_Layout.cshtml”: “Scripts”
- @Html.BeginForm Displaying “System.Web.Mvc.Html.MvcForm” on Page
- Styles.Render in MVC4
- How to write a comment in a Razor view?
- Could not load file or assembly Exception from HRESULT: 0x80131040
- MVC Razor @foreach
- The name ‘ViewBag’ does not exist in the current context – Visual Studio 2015
- “The transaction log for database is full due to ‘LOG_BACKUP'” in a shared host
- How to resolve “Server Error in ‘/’ Application” error?
- Chrome returns “Bad Request – Request Too Long” when navigating to local IIS Express
- JQuery – $ is not defined
- How to fix No connection could be made because the target machine actively refused it 127.0.0.1:64527
- What does ‘IISReset’ do?
- What does ‘IISReset’ do?
- Failed to load resource: the server responded with a status of 500 (Internal Server Error) in Bind function
- “Exception has been thrown by the target of an invocation” error (mscorlib)
- failed to load resource: the server response with a status 500 (internal server error)
- ASP.NET 5 MVC: unable to connect to web server ‘IIS Express’
- Does PHP supports MVP pattern?
- Why is this code throwing an InvalidOperationException?
- Twilio TwilioRestClient does not contain a definition for SendSmsMessage
- Net 2.0 Framework Service Pack 2 Issue
- Server.Transfer Vs. Response.Redirect
- W3WP.EXE using 100% CPU – where to start?
- HTTP Error 403.14 – Forbidden – The Web server is configured to not list the contents of this directory
- Error :The remote server returned an error: (401) Unauthorized
- Exception of type ‘System.OutOfMemoryException’ was thrown.
- System.web.mvc missing
- Uncaught SyntaxError: Invalid or unexpected token
- Cannot read configuration file due to insufficient permissions
- What is the difference between ASP.NET MVC 6 and ASP.NET Core 1.0 and the reason behind the core framework?
- Hidden field “ufprt” being added to Razor Umbraco Form – Why?
- How to add reference to System.Web.Optimization for MVC-3-converted-to-4 app
- How can I secure passwords stored inside web.config?
- Why not use Html.EditorForModel()
- limitations of using @Html.EditorForModel
- ASP.NET Why are sessions timing out, sessionstate timeout set
- Where can I find System.Web.Helpers, System.Web.WebPages, and System.Web.Razor?
- What does aspnet_regiis.exe do
- drop down list value in asp.net
- Cannot read configuration file due to insufficient permissions
- How to use the “Using” statement in ASP.net razor webpages?
- XML Parsing Error: no root element found Location in Console FF
- What is the difference between a web API and a web service?
- jQuery $.cookie is not a function
- Can you recommend a .net template engine?
- What is the use of @Html.AntiForgeryToken()?
- How do I resolve “HTTP Error 500.19 – Internal Server Error” on IIS7.0
- Asp.net Hyperlink control equivalent to
- Error ‘2035’ (‘MQRC_NOT_AUTHORIZED’) While Connecting to MQ
- What is the difference between “@Scripts.Render” and “
Recommended Hostings
Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.
FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.