Home Debugging DisplayFor Helper
Reply: 1

Debugging DisplayFor Helper

aggie
1#
aggie Published in 2018-01-10 07:11:00Z

I am trying to debug my DisplayFor(model => model.dateOfEmp) initally DateTime would display Date + time. To avoid this I added a display template with a ShortDate.

After I added a custom shortdateDisplayFor in the folder DisplayTemplate, it stopped emitting the default css class ID. So I have deleted it the template. However, it still emits the Shortdate and not the full date + time.

Question: I would like to debug this in Visual Studio, and know how can I find out which DisplayFor is being called.?

Fletch Zhou-MSFT
2#
Fletch Zhou-MSFT Reply to 2018-01-10 09:25:40Z

To avoid displaying Date + time, you may use DateTime.ToShortDateString Method and define the format via the DisplayFormat attribute: https://stackoverflow.com/a/28115051/5649051

As I tried debugging it, but it seem VS debugging tool could not step into the CSS template.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.382442 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO