how to get html control id from mvc

Let just think that i am using my control with model binding. now i want to get the control id without assign id. how to do that..?


    @Html.TextBoxFor(m => m.ServiceBenifitPayment.ServiceBenefitNoOfDays)  

 its simple just use firebug of Firefox. click on firebug then click








now select your control you will see control id.





Now use this control in script like set value




  document.getElementById('ServiceBenifitPayment_ServiceBenefitNoOfDays').value = ServiceBenefitDay;  



Popular posts from this blog

WPF Crystal Report Viewer Using SAP

ASP.NET MVC razor SAP Crystal report