attributes

What is [assembly: InternalsVisibleTo("MyAssembly")]? A statement, directive, ...?

Hi. Sorry about the vocabulary question but I can't find this anywhere: how do you call this below? [assembly: System.Runtime.CompilerServices.InternalsVisibleTo("MyAssembly")] Is it a statement, a directive, ... ? I want to indicate that you have to insert that line in order to give MyAssembly access to your assembly's internal membe...

Magento: add product twice to cart, with different attributes!

Hello all, I have been working with this for a whole day but i cannot find any solution: I have a product (lenses), which has identical attributes, but user can choose one attribute set for one eye and another attribute set for another. On the frontend I got it ok, see it here. So the user can select attributes for left or right eye, ...

Override Attribute in Partial Class (DBML)

Hi, Is it possible to override an attibute set on a partial class? So I have one autogenerated partial class like this: [Table(Name="dbo.Users")] public partial class MbsUser : INotifyPropertyChanging, INotifyPropertyChanged { This is generated in my DBML. The problem is, I don't want my class to use this table. I've cr...

Using MVC2, how do I validate that a date is within a given date range?

I have a requirement, in an MVC2 web application, to validate that the user is at least 13 years old. Is there a date/datetime validation attribute that will enable me to do this? ...

Using the ASP.NET MVC Attribute Based Route Mapper

In my ASP.NET MVC application, I want to use this ASP.NET MVC Attribute Based Route Mapper, first announced here. So far, I understand how to implement code that uses it, but I've run into a few questions that I think those who have used this attribute-based route mapper in the past will be able to answer. How do I use it with ActionR...

XML Namespace is required ?

Hello everybody I am learning xml and xml processing.I couldn't understand existence of namespace well. I learn that Namespace help us seperate same named elements in xml.Can't we discriminate elements by attributes which has same name ? Why namespace is important or required ? I want to give an example: <persons> <person></person>...

Javascript: How to change attributes of child elements?

I have this hidden link, which is needed for other purposes: <span id="notitle" style="display: none;"> <a href="...Foo" title="Foo" style="..."></a> </span> The link is generated dynamically and automatically includes the title attribute. But I'd like to remove the title attribute since the value is copied when the user copy-pastes s...

How to remove attributes for multiple child elements?

I have system-generated links which I hide manually. Now I want to remove the link's title attributes sicne those are copied when the user copies surrounding text. <html> <head> <script type="text/javascript"> var getElementsByClassName = function (className, tag, elm){ if (document.getElementsByClassName) { getElements...

How to attach a description to each ActionMethod in a Controller (ASP.net MVC)?

So recently, I came up with a way to dynamically build a nav-bar menu where the Controller (And its Index ActionMethod) would be listed in a horizontal bar at the top of each page (via Site.Master) but also based on the user's assigned roles. Each Controller listed would also list (in a vertical drop-down) the ActionMethods available to ...

How can I set an individual checkbox in a checkbox group to "checked" based on it's value attr ?

<div id="notifydaydiv" name="notifydaydiv" style="display:none; padding-left:50px"> <input name="notifyday" type="checkbox" value="wed" /> Wednesday <br /> <input name="notifyday" type="checkbox" value="thu" /> Thursday <br /> <span style="color:red; font-size:7pt;">Recommended</span><br /> <input name="notifyday" type="checkbox" va...

Javascript E4X: How do I properly iterate over an attribute XMLList?

Hi, I have a problem with retrieving attribute values via E4x in javascript. Suppose a list of XML nodes like the following as the XMLObject: <node att1="value1" att2="value2" att3="value3" att4="value4"> <nodeChild><!CDATA[/* ... */]></nodeChild> /* more node childs */ </node> I properly accessed the nodes (in a loop) and i...

Windows 7 File Date Question

apologies for not asking a strictly programming question, but this will move on to programming once my confusion is cleared. i am about to write a program that can modify file date stamps like created, modified, last accessed date. as i am investigating on Windows 7, it seems to provide more date fields. exactly how many file attrib...

IF/ELSE statements on IFrame Source attribute

Hi Everyone, I am currently defining the src attribute of my Iframe with the URL + a ID (of specific person) that I am retrieving from a database. It returns a picture that is stored at a repository for each person. For people that currently do not have a pic I would like the URL to be URL+00000 instead of the 404 error page. I'm tr...

how can python function access its own attributes?

is it possible to access the python function object attributes from within the function scope? e.g. let's have def f(): return SOMETHING f._x = "foo" f() # -> "foo" now, what SOMETHING has to be, if we want to have the _x attribute content "foo" returned? if it's even possible (simply) thanks UPDATE: i'd like the fo...

Inherit the UITypeEditor from Interface in PropertyGrid

As Attributes inherited from interfaces are not returned by the GetAttributes method, the PropertyGrid doesn't show the UITypeEditor associated with a property which is inherited from the Interface. To get it working I need to add the attribute to every time that implements the Interface. Is there any method in PropertyGrid that I can ...

Read MP3 Tag attribute in Silverlight

Hi. I know it works to read out the MP3 Tag attribute MP3V1 in silverlight. I know it works without any third party moduls. But when I use the MP3 workflow like Microsoft described I always get the count of zero attributes in my MP3 file. How to solve? Example project: Download MP3 demo file from here: http://www.file-upload.net/down...

ASP.NET MVC How to get Custom Validators to work with Client Side Validation

The following validation works fine on both client side and server side <DisplayName("website")> _ <StringLength(256, ErrorMessage:="Web Address cannot exceed 256 characters.")> _ <RegularExpression("^http(s?)\://[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(/\S*)?$", ErrorMessage:="Not a valid website address")> _ Public Property Web...

JavaScript - create element and set attributes

I've got these functions to create elements and change their attributes. Could you give me an advice on how to modify them? function create(elem) { return document.createElementNS ? document.createElementNS("http://www.w3.org/1999/ xhtml", elem) : document.createElement(elem); } function attr(elem, name, value) { if (!name || name....

Boost Spirit rule with custom attribute parsing

I am writing a Boost Spirit grammar to parse text into a vector of these structs: struct Pair { double a; double b; }; BOOST_FUSION_ADAPT_STRUCT( Pair, (double, a) (double, a) ) This grammar has a rule like this: qi::rule<Iterator, Pair()> pairSequence; However, the actual grammar of pairSequence is this: doub...

Custom Attributes and Type Checking

As I havent seen an answer to this question in my Google and site searches I thought I would pose it the great minds on this site. As C# does not support generic attributes (which does make sense), I was wondering if there is a way to restrict the type of an argument/property to the attribute based on the type it is decorating. Example:...