attributes

Asp.net controls' Attributes collection property

You can refer to this post of mine. WebControl.Attributes.Add(string key, string value); This is how Attributes property of an asp.net web control can be used. Can anyone provide me with the complete list of keys that are available for use with web controls? Any web link that contains the comprehensive list would be appreciated. ...

creating a custom attribute to control rounding behavior

I have a class with a lot of Decimal properties that are used for financial calculations. There are rules that specify how many decimal places to use when rounding each number. There is no global rule - some are two decimal places, some 0, some 8, etc. I'm trying to figure out the easiest way to approach this. I want to avoid having ...

Is it possible to compare private attributes in Ruby?

I'm thinking in: class X def new() @a = 1 end def m( other ) @a == other.@a end end x = X.new() y = X.new() x.m( y ) But it doesn't works. The error message is: syntax error, unexpected tIVAR How can I compare two private attributes from the same class then? ...

C#: What's the Difference Between TypeDescriptor.GetAttributes() and GetType() .GetCustomAttributes?

Take these two code things: instance.GetType() .GetCustomAttributes(true) .Where(item => item is ValidationAttribute); And TypeDescriptor.GetAttributes(instance) .OfType<ValidationAttribute>(); If the class looks like: [RequiredIfOtherPropertyIsNotEmpty("State", "City", ErrorMessage = ErrorDescription.CreateAccount_CityRequired...

Is there any way on how we could detect and get the attributes (which do not have properties) from a user control tag?

<uc1:UsercontrolTest ID="UsercontrolTest" runat="server" Hello="World"/> You see, Hello is not a property of UsercontrolTest class, but we need to detect and get that attribute. Are we allowed to do that? Thanks. ...

How do I call a function name that is stored in a hash in Perl?

I'm sure this is covered in the documentation somewhere but I have been unable to find it... I'm looking for the syntactic sugar that will make it possible to call a method on a class whose name is stored in a hash (as opposed to a simple scalar): use strict; use warnings; package Foo; sub foo { print "in foo()\n" } package main; my %...

Set or change Attribute's properties or fields at runtime in C#. Possible?

I believe there is no human way to change any attribute or field inside an Attribute apart from doing it in the constructor. That is, short of redesigning and recompiling Visual Studio yourself. There is already a similar question posted here: http://stackoverflow.com/questions/51269/change-attributes-parameter-at-runtime but I believe t...

img src & jQuery?

I have an image, and using jQuery I've turned it into a button. The so called button has two states: regular and pushed. Using jQuery I detect a "mousedown" and "mouseup" and replace the "src" attribute, like so: $("#btn").click(function() { ;//DO SOMETHING HERE WHEN PRESSED }); $("#btn").mousedown(function() { $(this).attr({ src...

Stick ID to the HTML element (using js) instead of id-attribute?

Hello! First post on stackoverflow. Hope everything is right! I'm thinking of attaching an ID value to the HTML element itself via JavaScript, instead of using the HTML id attribute. For instance, say that JavaScript variable htmlElement is a div. So htmlElement.cssName would tell us its CSS class. Now, how about doing htmlElement.id...

Why aren't F# records allowed to have AllowNullLiteralAttribute?

Is there a compiler implementation reason why records can't have the AllowNullLiteralAttribute attribute or is this a chosen constraint? I do see this constraint force cleaner code sometimes but not always. [<AllowNullLiteralAttribute>] type IBTreeNode = { mutable left : IBTreeNode; mutable right : IBTreeNode; mutable value : int} ...

JAXB unmarshalling ignoring namespace turns element attributes into null.

I'm trying to use JAXB to unmarshal an xml file into objects but have come across a few difficulties. The actual project has a few thousand lines in the xml file so i've reproduced the error on a smaller scale as follows: The XML file: The XSD file for producing JAXB classes <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"&...

Magento and unsetting a custom boolean attribute

Hi, I've added an attribute to a customer address entity. Attribute setup code is as follows- 'entity_type_id'=>$customer_address_type_id, 'attribute_code'=>'signature_required', 'backend_type'=>'int', 'frontend_input'=>'boolean', 'frontend_label' => 'Signature required', 'is_global' => '1', 'is_visible' => '1', 'is_required' => '0', '...

Overridden attribute access does not work (as expected)

The main objective of the following module, is to provide a kind of "constant" semantics for some names. class ConstantError(Exception): def __init__(self, msg): self._msg = msg class Constant(object): def __init__(self, name): self._name = name def __get__(self, instance, owner): ret...

How do I get the XMLSerializer to add namespaces to attributes in nested objects?

Hi, This is what I get: <ex:test soap:mustUnderstand="1" xmlns:ex="http://www.example.com/namespace"&gt; <ex:A Type="lorem">ipsum</ex:A> </ex:test> This is what I want: (Note that the Type-attribute is prefixed with ex.) <ex:test soap:mustUnderstand="1" xmlns:ex="http://www.example.com/namespace"&gt; <ex:A ex:Type="lorem">ipsum<...

Jquery - How to get the style display attribute "none / block"

Is there a way to get the style: display attribute which would have either none or block? DIV : <div id="ctl00_MainContentAreaPlaceHolder_cellPhone_input_msg_container" class="Error cellphone" style="display: block;"> <p class="cellphone" style="display: block;">Text</p> </div> I know that there is a way to find out if the DIV...

How do I reorder my input field by changing the attribute?

Hello, How do I reorder my inputs when my function is called? ie: When the a2 delete button is clicked now I have a1, a3, and a4 I want to reorder this so that it is a1, a2 (was a3), and a3(was a4). I know how to do this manually, but how do I write it dynamically? Script: $(function(){ $('.deleteMe').click(functio...

Select value with Linux command xpath (from Perl)

I want to get an attribute out of a XML-Tree. Therefor I use the command xpath from package libxml-xpath-perl. I figured out this command: virsh dumpxml save | xpath -e "/domain/devices/disk[@type='file']/source/@file[1]" This gives me file="/var/lib/libvirt/images/save.raw" How can I select the value only? (/var/lib/libvirt/image...

The Attribute of "ref" for XML Schema For C# Parse

Hello All, Good day. I got a problem about the attribute of "ref" for my XSD file. My code : using System; using System.Collections; using System.Xml; using System.Xml.Schema; class XmlSchemaTraverseExample { static void Main() { // Add the customer schema to a new XmlSchemaSet and compile it. // Any schema v...

Cannot Get params.play='false' in SWFObject 2.2 to work as expected, as documented, or as it *should*.

I am trying to do a very minimalistic sample of borderless video using swfobject and some cookie code that checks if a site visitor has been there before. The latter cookie code works, but basic SWFObject 2.2 code doesn't. My problem is that the SWFObject 2.2 library from code.google is not working as expected; specifically it is NOT o...

Controlling when the Static Constructor is called

In my custom attribute's static constructor, I search the loaded assembly for all classes decorated with my attribute and perform some action on them. I would like the static constructor to be called as soon as possible during runtime, preferably before execution of the static void Main() entry point. Currently it only gets called afte...