Top "Custom-attributes" questions

In .NET Framework, custom attributes are user defined attributes which enable providing metadata for application elements such as assemblies, classes and methods.

How to put conditional Required Attribute into class property to work with WEB API?

I just want to put conditional Required Attribute which is work with WEB API Example public sealed class EmployeeModel { [Required] …

c# asp.net-mvc-4 asp.net-web-api custom-attributes
Custom section/collection in Web.Config

I've got a bunch of routes that I want to be able to throw in my Web.Config file. I …

c# web-config custom-attributes
How do I set custom HTML attributes in django forms?

I have a Django form that is part of page. Lets say I have a field: search_input = forms.CharField(_(…

python html django forms custom-attributes
Getting the type of a MemberInfo with reflection

I'm using reflection to load a treeview with the class structure of a project. Each of the members in a …

c# .net reflection attributes custom-attributes
set/get dynamically custom attribute

Major modern browsers support setting/retrieving custom attribute dynamically, except IE-family. How can I set/get my custom attribute in …

javascript cross-browser dynamic custom-attributes
How can I add a custom root node when serializing an object with JSON.NET?

I have added a custom property to some of my objects like this: [JsonCustomRoot("status")] public class StatusDTO { public int …

c# json serialization json.net custom-attributes
Custom HTML tag attributes are not rendered by JSF

I want to add some iOS specific tag attributes to my login-form. If I have a look on my web …

html jsf custom-attributes renderer
How to use method parameter attributes

I've been struggling to find examples of how to write a custom attribute to validate method parameters, i.e., turn …

c# .net decorator custom-attributes
Get enum from enum attribute

I've got public enum Als { [StringValue("Beantwoord")] Beantwoord = 0, [StringValue("Niet beantwoord")] NietBeantwoord = 1, [StringValue("Geselecteerd")] Geselecteerd = 2, [StringValue("Niet geselecteerd")] NietGeselecteerd = 3, } with …

c# .net enums attributes custom-attributes
Get list of custom attributes for current action/controller in ASP.NET MVC

Checking out the sample code from http://lukesampson.com/post/471548689/entering-and-exiting-https-with-asp-net-mvc written for ASP.NET MVC2, I noticed they can …

asp.net-mvc custom-attributes authorize-attribute