I found this code to add an asterisk to my labels for required fields. I copied to my view and tested it to get it working as I want. So far so good.
Then I thought I should put this in a CSS file (I think) or something. Went on line to find a tutorial and got thoroughly confused as I do often. How do I put this into a file so it is reusable throughout the app rather than into each view which I would
have to do now? Sorry if this is too simple.
Member
25 Points
95 Posts
No Idea What to Do Now
Jul 07, 2017 11:35 PM|BitLost|LINK
I found this code to add an asterisk to my labels for required fields. I copied to my view and tested it to get it working as I want. So far so good.
Then I thought I should put this in a CSS file (I think) or something. Went on line to find a tutorial and got thoroughly confused as I do often. How do I put this into a file so it is reusable throughout the app rather than into each view which I would have to do now? Sorry if this is too simple.
Member
250 Points
151 Posts
Re: No Idea What to Do Now
Jul 08, 2017 10:25 AM|hkholakiya|LINK
Hi BitLost,
You can create .css file and add your below class into new created file:
Add this file reference into Bundle.cofig file which available in the App_Start folder.
Use that bundle reference into your master page and you can use this class in all pages which come under your master page.
Hope it helps you. If yes please mark as answer.
Regards,
Hasmukh(Skype: hkholakiya, Email : hasu.kholakiya@gmail.com)
Experienced (Asp.net, MSSQL, C#, VB.NET, Entity Framework, MVC, SP, WCF, WebAPI)
Member
25 Points
95 Posts
Re: No Idea What to Do Now
Jul 08, 2017 09:32 PM|BitLost|LINK
Thanks for that. It looks on the right path. Except I am using net core so I don't have bundle.config App_start of masterpage.
But pointed me in right direction and enabled me to find my mistake. Thanks