Tuesday, January 28, 2014

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;  

C# print file on LAN Printer

If you want to print any file on network printer then you can try with this code block // Change Default Printer System.Ma...