You can set ID of a textbox like this.
@Html.TextBoxFor(item => item.OperationNo, new { id = "MyId" })
OR
@Html.TextBoxFor(item => item.OperationNo, htmlAttributes: new { id = "MyId" })
Output:
<input ... id="MyId" name="OperationNo" type="text" />
Related Contents:
- Using Razor within JavaScript
- ASP.NET MVC 3 Razor: Include JavaScript file in the head tag
- Using Razor, how do I render a Boolean to a JavaScript variable?
- Razor MVC Populating Javascript array with Model Array
- How to access javascript variable within @URL.Action()
- Is it OK to put JavaScript in Partial Views
- Calling ASP.NET MVC Action Methods from JavaScript
- Razor/JavaScript and trailing semicolon
- In ASP.NET MVC: All possible ways to call Controller Action Method from a Razor View
- How do I update a model value in JavaScript in a Razor view?
- Passing data to a bootstrap modal
- Calculate text width with JavaScript
- JQuery – $ is not defined
- How to detect a textbox’s content has changed
- How can I set focus on an element in an HTML form using JavaScript?
- How to pass json POST data to Web API method as an object?
- How to open a URL in a new Tab using JavaScript or jQuery? [duplicate]
- ASP.NET MVC JsonResult Date Format
- Render Partial View Using jQuery in ASP.NET MVC
- Set keyboard caret position in html textbox
- Vue.js get selected option on @change
- force browsers to get latest js and css files in asp.net application
- Populate a Razor Section From a Partial
- Difference between window.location.href and top.location.href
- asp.net-mvc: razor ‘@’ symbol in js file
- Relative Paths in Javascript in an external file
- How can I detect if Flash is installed and if not, display a hidden div that informs the user?
- Passing data to a jQuery UI Dialog
- Passing dynamic javascript values using Url.action()
- Difference between $.post and $.ajax?
- Why would multiple simultaneous AJAX calls to the same ASP.NET MVC action cause the browser to block?
- Using Bootstrap Modal window as PartialView
- Asp.Net Mvc Url.Action in external js file?
- javascript best practices for asp.net mvc developers
- Javascript, Razor and Escape characters. Like apostrophe
- Razor Syntax and Javascript
- Pass Array from MVC to javascript?
- Inversify.js – Reflect.hasOwnMetadata is not a function
- Change selected value of kendo ui dropdownlist
- How to set javascript variables using MVC4 with Razor
- How to tell razor NOT to html escape
- How to know if the text in a textbox is selected?
- Setting maxlength of textbox with JavaScript or jQuery
- How to post ASP.NET MVC Ajax form using JavaScript rather than submit button
- Best way to restrict a text field to numbers only?
- Initializing Vue data with AJAX
- Select from array of objects based on property value in JavaScript [duplicate]
- Cassette bundles vs MVC4 bundles
- Uncaught SyntaxError: Invalid or unexpected token
- Get current cursor position in a textbox