Wednesday, 14 January 2015

How to do data dash data- attributes in Razor

Answer: Use an underscore

In the cshtml view file definition when declaring the attributes in the new {} object class for the attributes, use data_mycustomdataattribute to render out data-mycustomdataattribute

@Html.Hidden("controlName", "valueHere", new { @data_mycustomdataattribute = "testing dash"})

This will render the following...

<input data-mycustomdataattribute="testing dash" id="controlName" name="controlName" type="hidden" value="valueHere">

How to replace the watch battery in Logitech K750 solar power keyboard

Buy this battery http://www.watchbattery.co.uk/shop/products/BB-ML2032.shtml Open the battery cover on the back of the keyboard, you’ll need...