Search Results

Search found 10804 results on 433 pages for 'attribute keys'.

Page 46/433 | < Previous Page | 42 43 44 45 46 47 48 49 50 51 52 53  | Next Page >

  • map xml element to xsd complexType based on attribute

    - by Joshua Johnson
    Assume there exists an XML instance document that looks like this: <root> <object type="foo"> <!-- ... --> </object> <object type="bar"> <!-- ... --> </object> </root> My goal is to have a small (static) schema that verifies proper <element type="xxx" /> syntax for objects, and another schema (more prone to change) that verifies the contents of each object element against a complexType that matches the type attribute: <complexType name="foo"><!--should match object with type="foo"--></complexType> <complexType name="bar"><!--should match object with type="bar"--></complexType> What is the best way to accomplish this (or something similar)?

    Read the article

  • PreApplicationStartMethod Attribute causes exception

    - by Joop
    Strange thing happening to me with the PreApplicationStartMethod Attribute. I did implement it in my latest project. In the AssemblyInfo.cs I have the following line: [assembly: PreApplicationStartMethod(typeof(MyAssembly.Initializer), "Initialize")] The Type and method look like this: namespace MyAssembly { public static class Initializer { public static void Initialize() { TranslationKeys.Initialize(); } } } When I rebuild my application and load it in the browser I get the following error: The method specified by the PreApplicationStartMethodAttribute on assembly 'MyWebApp, Version=0.0.1.0, Culture=neutral, PublicKeyToken=null' cannot be resolved. Type: 'MyAssembly.Initializer', MethodName: 'Initialize'. Verify that the type is public and the method is public and static (Shared in Visual Basic). I really have no idea what the problem is.

    Read the article

  • There is no Key attribute in EF CTP 5

    - by Spence
    According to the blog post here Data Annotations in the Entity Framework there should be an attribute for a column called "Key" which allows you to mark the primary key of an entity. However I cannot locate this in .Net 3.5 or .Net 4.0. What have I missed? I've included the reference to EntityFramework.dll and I've checked all the attributes under System.ComponentModel.DataAnnotations but I cannot locate it. I have set my project to .Net 4.0 full (not client profile). Any ideas?

    Read the article

  • How to build C# object from a FormCollection with complex keys

    - by ob
    i have a javascript object, obj, that gets passed to an mvc action via a $.post() like so: var obj = { Items: [{ Text: "", Value: { Property1: "", Property2: "" }, { Text: "", Value: { Property1: "", Property2: "" }] }; $.post('MyAction', obj, function() {}); the action signature looks like this: public ActionResult MyAction(FormCollection collection) { } i need to be able to build an object from the FormCollection, however i'm running into an issue where the keys are in the form: "Items[0][Text]" "Items[0][Value][Property1]" "Items[0][Value][Property2]" "Items[1][Text]" "Items[1][Value][Property1]" "Items[1][Value][Property2]" i'm wondering if there's a clean way to build the desired C# object from the given FormCollection. i understand that i could change the action method signature to take in the type of object i'm interested in, but that was presenting its own issues.

    Read the article

  • Button click doesn't call function even when button attribute OnClick is set to that function

    - by Silmaril89
    Hi, I have an aspx page with two buttons, one of the buttons has an OnClick attribute to a function that should be run when clicked. When the other button is clicked there is an if statement checking if the page is a postback, if it is then I run some statements that need to be run when that button is clicked. That postback button works fine. However, the other button, when it's clicked the function it's supposed to call never executes, and the statements inside if (Page.IsPostBack) get executed instead. What can I do to fix this? Is there a way to make the button that calls a function not do a Post back?

    Read the article

  • TinyMCE or HTML5's contentEditable attribute?

    - by Mike
    I have always hated wysiwyg editors but most of the applications I develop they are necessary for our clients to edit their content. After trying out a few different ones I seemed to like tinyMCE the best. Although powerful and seems to generate fairly good HTML it is not without its issues. Recently I have been thinking about creating a custom wysiwyg that suits my needs perfectly taking advantage of the contentEditable attribute. Is this HTML5 feature ready? Will I have many cross browser issues? What are its limitations? I guess my question finally boils down to; Will it be worth throwing in the towel on 3rd party wysiwygs and moving to contentEditable regions?

    Read the article

  • Design Time Attribute For CSS Class in ASP.net Custom Server Control

    - by Jon P
    Hopefully some Custom Control Designers/Builders can help I'm attempting to build my first custom control that is essential a client detail collection form. There are to be a series of elements to this form that require various styles applied to them. Ideally I'd like the VS 2005/2008 properties interface to be able to apply the CSSClass as it does at the control level, i.e. with a dropdown list of available CSS Clases. Take for example the Class to be applied to the legend tag /// <summary>Css Class for Legend</summary> [Category("Appearance")] [Browsable(true)] [DefaultValue("")] //I am at a loss as to what goes in [Editor] [Editor(System.Web.UI.CssStyleCollection), typeof(System.Drawing.Design.UITypeEditor))] public string LegendCSSClass { get { return _LegendCSSClass; } set { _LegendCSSClass = value; } } I have tried a couple of options, as you can see from above, without much luck. Hopefully there is something simple I am missing. I'd also be happy for references pertaining to the [Editor] attribute

    Read the article

  • In Clojure - How do I access keys in a vector of structs

    - by Nick
    I have the following vector of structs: (defstruct #^{:doc "Basic structure for book information."} book :title :authors :price) (def #^{:doc "The top ten Amazon best sellers on 16 Mar 2010."} best-sellers [(struct book "The Big Short" ["Michael Lewis"] 15.09) (struct book "The Help" ["Kathryn Stockett"] 9.50) (struct book "Change Your Prain, Change Your Body" ["Daniel G. Amen M.D."] 14.29) (struct book "Food Rules" ["Michael Pollan"] 5.00) (struct book "Courage and Consequence" ["Karl Rove"] 16.50) (struct book "A Patriot's History of the United States" ["Larry Schweikart","Michael Allen"] 12.00) (struct book "The 48 Laws of Power" ["Robert Greene"] 11.00) (struct book "The Five Thousand Year Leap" ["W. Cleon Skousen","James Michael Pratt","Carlos L Packard","Evan Frederickson"] 10.97) (struct book "Chelsea Chelsea Bang Bang" ["Chelsea Handler"] 14.03) (struct book "The Kind Diet" ["Alicia Silverstone","Neal D. Barnard M.D."] 16.00)]) I would like to sum the prices of all the books in the vector. What I have is the following: (defn get-price "Same as print-book but handling multiple authors on a single book" [ {:keys [title authors price]} ] price) Then I: (reduce + (map get-price best-sellers)) Is there a way of doing this without mapping the "get-price" function over the vector? Or is there an idiomatic way of approaching this problem?

    Read the article

  • Subclassing Satchmo's Category model, but then getting the error "'Manager' object has no attribute 'root_categories'"

    - by hellsgate
    I'm using Satchmo as part of a website I'm currently building. At the moment I'm trying add more functions to the Satchmo Category class, but obviously I'm not going to make any changes to the Satchmo files. So, I thought that subclassing the Category class would give me a new class which contains all the Satchmo Category properties and methods while allowing me to add my own. However, either Python subclassing doesn't work like that, or I am doing it wrong. Here is the code I'm using to subclass Category: from product.models import Category class MyCategory(Category): """ additional functions to pull data from the Satchmo store app """ One of the methods I can normally use from the Category class is: Category.objects.root_categories() however, when I try to access MyCategory.objects.root_categories() I get the following error: AttributeError: 'Manager' object has no attribute 'root_categories' Can anyone point me in the right direction for solving this?

    Read the article

  • How do I store keys pressed

    - by Glycerine
    I would like to store keys pressed when I listen out for the keyDown on the stage. I can add the listener fine, but I'm not getting the character I want out of the event to store it into a string. This is what I have so far: private var _addToString:String = ""; public function Hotwire() { this.addEventListener(KeyboardEvent.KEY_DOWN, keydownEventHandler); } private function keydownEventHandler(ev:KeyboardEvent):void { trace("Key pressed: " + ev.charCode ); addToString(ev.charCode); } private function addToString(value:uint):String { trace(_addToString); return _addToString += String.fromCharCode(value); } Every key I press its returns '0'. How do I convert the chatCode to a real alphanumeric character I can read later? Thanks in advance

    Read the article

  • Using attribute text value in AngularJS directive

    - by C1pher
    Using a YouTube tutorial created by John Lindquist, I was able to create a directive using a template. See fiddle: http://jsfiddle.net/37PSs/ Now, I want to use the value of the attribute as a variable to a function call. Something like this: html: <hello-world name="World"></hello-world> javascript - directive: template: '<span>myFunction({{name}})</span>' javascript - myFunction(theirName): return ("Hello, " + String(theirName) + "!"); The closest I've been able to get is passing an [object Window] to my function.

    Read the article

  • ProductListing based on Attribute in Magento

    - by Keenora Fluffball
    I would like to show "Suggestions" in my product listing in Magento. I made an attribute "Suggestion" which is Yes/No and global active. Now in the listing I would like to show the suggestions first, then some text and stuff, and then the rest of products. I tried it like this: $_productCollection=$this->getLoadedProductCollection() /* .... */ $_productCollection->clear()->addAttributeToFilter('suggestion', 1)->load(); But this ends in an exception: You cannot define a correlation name '_price_rule' more than once Now the question is, how to solve this?

    Read the article

  • how to copy attribute XML node to specified structure or array

    - by jozi
    how to copy attribute XML node to specified structure or array with one command for example public struct PossibilityJavamed { public string derv; public string dervt; public string num; public string gend; } PossibilityJavamed tmpstructnew = tmpstruct; ArrayList alstout = new ArrayList(); XmlNodeList nodeList; nodeList = docHarf.SelectNodes("//adatesmi"); for (int i = 0; i < nodeList.Count; i++) { tmpstructnew.derv = nodeList[i].Attributes["derv"].Value; tmpstructnew.dervt = nodeList[i].Attributes["dervt"].Value; tmpstructnew.num = nodeList[i].Attributes["num"].Value; tmpstructnew.gend = nodeList[i].Attributes["gend"].Value; alstout.Add(tmpstructnew); } but i will do it in one command

    Read the article

  • Testing a Django view cause "AttributeError: 'NoneType' object has no attribute 'handler500'" error

    - by jack
    I just wanted to start testing a Django view using the code below: from django.test.client import Client c = Client() response = c.get('/search/keyword') print response.content It just throws out following error message: "/usr/local/lib/python2.6/dist-packages/django/test/client.py", line 286, in get response = self.request(**r) File "/usr/local/lib/python2.6/dist-packages/django/test/client.py", line 230, in request response = self.handler(environ) File "/usr/local/lib/python2.6/dist-packages/django/test/client.py", line 74, in __call__ response = self.get_response(request) File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/base.py", line 143, in get_response return self.handle_uncaught_exception(request, resolver, exc_info) File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/base.py", line 178, in handle_uncaught_exception callback, param_dict = resolver.resolve500() File "/usr/local/lib/python2.6/dist-packages/django/core/urlresolvers.py", line 268, in resolve500 return self._resolve_special('500') File "/usr/local/lib/python2.6/dist-packages/django/core/urlresolvers.py", line 258, in _resolve_special callback = getattr(self.urlconf_module, 'handler%s' % view_type) AttributeError: 'NoneType' object has no attribute 'handler500' The view works in browser. What's wrong with above code?

    Read the article

  • Append a string to the end of an element attribute using jQuery

    - by ILMV
    I have an element: <select id="row" /> I want to append a string to the end of the id attribute, like this: <select id="row_1" /> The jQuery I am using to achieve this is (from within an each): $(this).attr('id',$(this).attr('id')+'_'+row_count); This looks ugly as sin, and whilst it works I want to know if there is a simpler solution. In this example, the ID prefix (e.g. row) is never constant, so I can't just do 'row_'+row_count. Cheers!

    Read the article

  • Interface "not marked with serializable attribute" exception

    - by Joel in Gö
    I have a very odd exception in my C# app: when trying to deserialize a class containing a generic List<IListMember> (where list entries are specified by an interface), an exception is thrown reporting that "the type ...IListMember is not marked with the serializable attribute" (phrasing may be slightly different, my VisualStudio is not in English). Now, interfaces cannot be Serializable; the class actually contained in the list, implementing IListMember, is [Serializable]; and yes, I have checked that IListMember is in fact defined as an interface and not accidentally as a class! I have tried reproducing the exception in a separate test project only containing the class containing the List and the members, but there it serializes and deserializes happily :/ Does anyone have any good ideas about what it could be?

    Read the article

  • jQuery to get the text attribute of a checkbox

    - by Andriyev
    Hi I'm adding a check box to a page using the following statement; <script language="C#" runat="server"> protected void Page_Load ( object src, EventArgs e ) { if (!IsPostBack) { CheckBox XChkBox = new CheckBox(); //instance of System.Web.UI.WebControls.CheckBox XChkBox.ID = "someId" XChkBox.Text = "someText" somePlaceHolder.Controls.Add(XChkBox); } } </script> I need to get the Text attribute of that check box on click. I tried $(this).attr('Text'); inside $('input[type=checkbox]').click(function(){}); but it returns undefined. Where am I going wrong? Please suggest. cheers

    Read the article

  • Using Multiple Foreign Keys to the same table in LINQ

    - by Graeme
    I have a table Users and a table Items In the Items table, I have fields such as ModifiedBy CreatedBy AssignedTo which all have a userId integer. The database is set up to have these as foreign keys back to the Users table. When using LINQToSQL, the relationships which are automatically built from the dbml end up giving me names like User, User1 and User2 e.g. myItem.User1.Name or myItem.User2.Name Obviously this isn't very readable and I'd like it be along the lines of myItem.CreatedByUser.Name or myItem.ModifiedByUser.Name etc I could change the names of the relationships but that means I have to redo that every time I change the db schema and refresh the dbml. Is there any way round this?

    Read the article

  • How to add css to form elements if attribute class is already being used in Jquery

    - by Gublooo
    Hey guys This is probably a dumb question - I'm using Jquery to validate the form. So the form elements have the class="required" attribute. input type="text" name="last_name" class="required"/ Now if i want to apply some css properties to the input fields of this form - how do I do that. I do not want to declare a general css for all input elements - I have declared the css as follows: input.form { color: #000; background: #fff; border: 2px solid #E1E1E1; font-size: 16pt; width:150px; } And I want to use it this way input class="form" type="text" name="last_name" class="required"/ But this wont work as there are two class attributes here. So how do I handle this. Thanks

    Read the article

  • How to define the order with ImportMany attribute?

    - by JD
    Hi to all, I am just getting into MEF and was wondering how you could define the order of collection exported with [ImportMany]? What I mean here is if I had two classes (Class1, Class2) that implement the interface IService and each of the implementations are in two different libraries (although they could be in the same), I want the Class2 instance to be created before the Class1 instance in the IEnumerable collection defined by the ImportMany attribute. So it is like a pipeline of functionality where Class2 calls are made before Class1 calls. Also, I have an another Class (Class3 which also implements IService) in another library, which I want introduced later on (i.e. some logging utility), how do I make this the 3rd instance in the ImportMany collection? JD

    Read the article

  • Use the [Serializable] attribute or subclassing from MarshalByRefObject?

    - by Theo Lenndorff
    I'd like to use an object across AppDomains. For this I can use the [Serializeable] attribute: [Serializable] class MyClass { public string GetSomeString() { return "someString" } } Or subclass from MarshalByRefObject: class MyClass: MarshalByRefObject { public string GetSomeString() { return "someString" } } In both cases I can use the class like this: AppDomain appDomain = AppDomain.CreateDomain("AppDomain"); MyClass myObject = (MyClass)appDomain.CreateInstanceAndUnwrap( typeof(MyClass).Assembly.FullName, typeof(MyClass).FullName); Console.WriteLine(myObject.GetSomeString()); Why do both approaches seem to have the same effect? What is the difference in both approaches? When should I favor the one approach over the other? EDIT: At the surface I know that there are differences between both mechanisms, but if someone jumped out of a bush and asked me the question I couldn't give him a proper answer. The questions are quite open questions. I hoped that someone can explain it better than I could do.

    Read the article

  • Check for default value of attribute in XPath

    - by iref
    Hi, i have XML schema: <xsd:complexType name="contactsType"> <xsd:sequence> <xsd:element name="contact" type="contactType" minOccurs="0" maxOccurs="unbounded"/> </xsd:sequence> <xsd:attribute name="visible" type="xsd:boolean" default="true"/> </xsd:complexType> and i want to find all contacts which have @visible=true, //contacts[@visible='true'] but this expression doesn' t return nodes without set @visible like this: <contacts /> so i want to know if there is any function in XPath which returns also default values of attributes Thanks Jan

    Read the article

  • Managing Foreign Keys

    - by jwzk
    So I have a database with a few tables. The first table contains the user ID, first name and last name. The second table contains the user ID, interest ID, and interest rating. There is another table that has all of the interest ID's. For every interest ID (even when new ones are added), I need to make sure that each user has an entry for that interest ID (even if its blank, or has defaults). Will foreign keys help with this scenario? or will I need to use PHP to update each and every record when I add a new key?

    Read the article

  • how do I put a variable inside an attribute for an href tag

    - by Ido
    Hi I'm new to scripting Trying to change the css acording to a url variable, using jqURL plugin. for some reason this does not work for me: $(function(){ var n= $.jqURL.qs(); alert(n) $("link[rel=stylesheet]").attr({href : 'n + ".css"'}); }); the alert is there for debug, and works well, so it is a matter of how i put the var in the attribute. this, for example, works fine: if(n == 'red') { $("link[rel=stylesheet]").attr({href : "red.css"});} help please

    Read the article

  • Using the "naked" attribute for functions in GCC

    - by Art Spasky
    GCC documentation (http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html) states in 6.29 Declaring Attributes of Functions "naked Use this attribute on the ARM, AVR, IP2K, RX and SPU ports to indicate that the specified function does not need prologue/epilogue sequences generated by the compiler. It is up to the programmer to provide these sequences. The only statements that can be safely included in naked functions are asm statements that do not have operands. All other statements, including declarations of local variables, if statements, and so forth, should be avoided. Naked functions should be used to implement the body of an assembly function, while allowing the compiler to construct the requisite function declaration for the assembler." Can I safely call functions using C syntax from naked functions, or only by using asm?

    Read the article

< Previous Page | 42 43 44 45 46 47 48 49 50 51 52 53  | Next Page >