custom-attributes

Can I define a jsp custom tag to extend a standard html tag?

For example: <c:a href="/myurl" style="margin: 5px;" addJsessionId="true" logEvent="true"> click here</c:a> such that: 1) all standard attributes of (style) are propagated as is. 2) my tag handler implementation handles the custom attributes (addJsessionId and logEvent in this case). ...

Is there any way I can store more attributes with fields/classes in Entity Framework?

By default Navigation Properties in Entity Frameworks creates properties at both the end of associations, now the problem I am facing is, I want to mark some associations to generate properties at both ends and some to generate only for child of association. Ok I know I can customize the template, but I have no way to store any informati...

jQuery Selectors

I am trying to get an array of checkboxes that ARE checked AND have a certain attribute (tag) that is NOT blank. (I know that the attribute called tag is not HTML compliant but it does work across the major browsers and makes life alot simpler!) e.g. <input type="checkbox" name="First" tag="[email protected]" checked="checked"> <inp...

Combine my Attributes on a Linq to SQL Entity Property

I have a Linq to SQL dbml.cs file with this in it: [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PantsName", DbType="VarChar(248)")] [global::System.Runtime.Serialization.DataMemberAttribute(Order=3)] public string PantsName { get { return this._PantsName; } set { if ((this._PantsName != value)) { this._PantsName = val...

What do other people think of using "custom" attributes to make things easier (in jQuery)...

Hey, I am currently jQuerifying (if there is such a word) my website. I am not good at JavaScript at all, and not great on jQuery. Object orientation is way passed me in JS, but the rest of my site is object oriented VB.net. I noticed, from some experience I had of jQuery a while back, just how difficult it can be when loading pages for...

Specify an Inline Array to Custom Attribute in VB.NET

I would like to know if there's any way to specify an inline array (lets say of strings) to custom attribute on a property in vb.net. I have the following example that doesn't compile in vb.net (.net 1.1): Attributes.ManyToOne(New String() {"a", "b", "c"})> _ Public Property PaymentTerms() As PaymentTerms The attribute is defined in ...

How do I use update_attributes with custom setter methods in Rails?

I have a model called Contact with an attribute called phone_number. I have some custom setter methods such as def prefix=(num) self.phone_number[3..5] = num end When I call @contact.update_attributes({:prefix => '510'}), I don't get any errors and @contact gets changed, but the changes don't make their way to the database. I've tr...

Custome attributes in html

How to add a custome attribute to a HTML control. <input type="text" validate="xyz"></input> I want to add a new attribute to the HTML control. validate here is the cutome attribute. ...

Custom Attribute in ASP.NET for Page_Load

Hi, I have an ASP.NET 3.5 Site where, in some places, I am checking if the currently logged on Active Directory user is in a certain AD Security Group. In the Page_Load I'm doing something like this: if (isInADGroup(UserGUID)) { //proceed } Now I was wondering, couldn't I just create a Custom Attribute, like some of MVC's securit...

Retrieve custom attribute parameter values?

if i have created an attribute: public class TableAttribute : Attribute { public string HeaderText { get; set; } } which i apply to a few of my properties in a class public class Person { [Table(HeaderText="F. Name")] public string FirstName { get; set; } } in my view i have a list of people which i am displaying in a t...

custom condition method attributes in C#

I'm wondering if I can do something like this in c#: public CustomerManagerScreen() { [TestAttirubute("CustomerManagerScreen_Load")] private void CustomerManagerScreen_Load(object sender, EventArgs e) { CustomerLoad(); } } as you can see, method name is a paramet...

What happens if you use custom attribute in a HTML tag?

Hi, this question isn't related to jQuery itself but I found a plugin named Metadata found there and one of the example uses custom tag attribute: <li data="{some:'random', json: 'data'}">...</li>. Q: Is that cross-browser? Will this fail when validating markup? Thanks. ...

Creating Custom Objects at runtime in C#

I want to create custom objects in C# at runtime, the objects will have properties imported from an xml file. The xml file looks something like this: <field name="FirstName" value="Joe" type="string" /> <field name="DateAdded" value="20090101" type="date" /> I would like to create objects in c# that have properties such as FirstName a...

Checking if field data changed before leaving page

How should you place one validator on a masterpage that wont allow postback of any content pages until all changed control data on that page has been either saved or canceled. The specifics of my current situation and the way its currently being done on my project are listed below This is an IE web application. The application is curre...

Reflection and custom ControlDesigner doesn't seem to work in c#

I have made a custom ControlDesigner that I need to include and exclude properties shown in the property grid. But for some reason it seems just to ignore the code? I don't know what I might have done wrong? Could I be missing something? Do I need to setup VS or something? Also in the examples I have found they seem to disagree about wh...

Why predicate isn't filtering when building it via reflection

I'm building a rather large filter based on an SearchObject that has 50+ fields that can be searched. Rather than building my where clause for each one of these individually I thought I'd use some slight of hand and try building custom attribute suppling the necessary information and then using reflection to build out each of my predica...

Custom Attributes and enumerators

Hey There I have an enum: public enum Navigation { Top = 0, Left = 2, Footer = 3 } And i have a controller action: public ActionResult Quotes() { return View(); } I would like to be able to decorate my action as follow: [Navigation.Top] public ActionResult Quotes() { return View(); } Any idea how this could ...

Can I query for attribute key wildcards in jQuery?

I'd like to select elements with attribute names (keys) that begin with a set string. Use case: the jQuery UI dialog creates buttons whose only unique identifers are a pseudo-random custom attribute with a sequential value such as jQuery1288273859637="40" I'd like to select based on the fact that the attribute's name is jQuery* (begins ...