In a recent Asp.Net MVC project i had to set a focus on a specific control, but it wasn’t just a specific control. It was calculate in runtime by some conditions. I didn’t just want to create an extra string property on the viewmodel where i could store the id of the control. Off course this would also work but i wanted something safer than those magic strings. In one of my previous posts (Where is the ClientID?), i was able to determine the Id that is created by the HtmlHelper to create a textbox, checkbox, … public static class HtmlHelper{ public static String GetId<TModel,TProperty>(...
2012-05-16
ASP.NET MVC: Set Focus, ViewModel Style
Posted by
Kenny Tordeur
,
at
Wednesday, May 16, 2012

Read more →
Subscribe to:
Posts (Atom)