I use MVC4 with razor. I ran into the problem of formating correctly a DateTime property of my model that I render in the view using a TextBoxFor MVC helper. The default formatting displays the full date with hours, minutes and seconds : @Html.TextBoxFor(m => m.BeginDate) displays “27/04/2012 00:00:00” in the textbox. I only needed the first part so I wanted to use the ‘d’ format. I then tried to use DataAnnotations to impose a format to the property to display: [DisplayFormat(DataFormatSt... ......
I was looking for a kind of onselected trigger for the JQueryUI accordion (v 1.8.11). The proper way to do this is to use the “change” event of the accordion : <script type="text/javascript"> $(document).ready(function () { $("#accordion").accordion({ change: function (event, ui) { alert("changed!"); } }); }); Now, you might want to get the selected pane index. This is quite easy too : <script type="text/javascript"> $(document).ready(function () { $("#accordion").accordion({ active: ......