Search Results

Search found 4252 results on 171 pages for 'david 85'.

Page 81/171 | < Previous Page | 77 78 79 80 81 82 83 84 85 86 87 88  | Next Page >

  • SQL statement with datetimepicker

    - by David Archer
    This should hopefully be a simple one. When using a date time picker in a windows form, I want an SQL statement to be carried out, like so: string sql = "SELECT * FROM Jobs WHERE JobDate = '" + dtpJobDate.Text + "'"; Unfortunately, this doesn't actually provide any results because the JobDate field is stored as a DateTime value. I'd like to be able to search for all records that are on this date, no matter what the time stored may be, any help? New query: SqlDataAdapter da2 = new SqlDataAdapter(); SqlCommand cmd = new SqlCommand(); cmd.CommandText = "SELECT * FROM Jobs WHERE JobDate >= @p_StartDate AND JobDate < @p_EndDate"; cmd.Parameters.Add ("@p_StartDate", SqlDbType.DateTime).Value = dtpJobDate.Value.Date; cmd.Parameters.Add ("@p_EndDate", SqlDbType.DateTime).Value = dtpJobDate.Value.Date.AddDays(1); cmd.Connection = conn; da2.SelectCommand = cmd; da2.Fill(dt); dgvJobDiary.DataSource = dt; Huge thanks for all the help!

    Read the article

  • ASP.NET MVC POST Parameter into RouteData

    - by David Thomas Garcia
    I'm using jQuery to POST an Id to my route, for example: http://localhost:1234/Load/Delete with a POST Parameter Id = 1 I'm only using the default route in Global.asax.cs right now: routes.MapRoute( "Default", "{controller}/{action}/{id}", new { controller = "Home", action = "Index", id = "" } ); When I perform the POST, in my ActionFilter filterContext.RouteData.Values["Id"] is set to the default value of "". Ideally, I'd like it to use the POST Parameter value automatically if the URL comes up with "". I know it is posting properly because I can see the value of "1" in filterContext.HttpContext.Request.Params["Id"]. Is there a way to get RouteData to use a POST parameter as a fall back value?

    Read the article

  • Macros's that define macros

    - by David Thornley
    Does anyone know how to pull off something like this... I have alot of repetitive macros as : - #define MYMACRO1(x) Do1(x) #define MYMACRO2(x,y) Do2(x, y) #define MYNEXTMACRO1(x) Do1(x) #define MYNEXTMACRO2(x,y) Do2(x, y) The code above works fine, but I want to write a macro that creates macros (a meta macro). For example: - #define MYMETAMACRO(name) \ #define #name1(x) Do1(x) \ #define #name2(x,y) Do2(x, y) \ Such that I can do : - MYMETAMACRO(MYMACRO); MYMETAMACRO(MYNEXTMACRO); and then : - MYMACRO1(2); MYMACRO2(2,3); MYNEXTMACRO1(4); MYNEXTMACRO2(4, 5); The preprocessor bombs out at the #define as it thinks it is a missing parameter of the macro.

    Read the article

  • Packing jQuery plugin - jFeed

    - by David Neale
    I have a modified version of the jFeed plugin and now want to pack the four source files. There is a Makefile and some perl scripts in the download but I don't know how to use them. This is the file structure: \Makefile \proxy.php \src\jatom.js \src\jfeed.js \src\jfeeditem.js \src\jrss.js \build\packer\jsPacker.pl \build\packer\Pack.pm \build\packer\ParseMaster.pm

    Read the article

  • Bouncycastle encryption algorithms not provided

    - by David Read
    I'm trying to use BouncyCastle with android to implement ECDH and EL Gamal. I've added the bouncycastle jar file (bcprov-jdk16-144.jar) and written some code that works with my computers jvm however when I try and port it to my android application it throws: java.security.NoSuchAlgorithmException: KeyPairGenerator ECDH implementation not found A sample of the code is: Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider()); java.security.KeyPairGenerator keyGen = org.bouncycastle.jce.provider.asymmetric.ec.KeyPairGenerator.getInstance("ECDH", "BC"); ECGenParameterSpec ecSpec = new ECGenParameterSpec("prime192v1"); keyGen.initialize(ecSpec, SecureRandom.getInstance("SHA1PRNG")); KeyPair pair = keyGen.generateKeyPair(); PublicKey pubk = pair.getPublic(); PrivateKey prik = pair.getPrivate(); I then wrote a simple program to see what encryption algorithms are available and ran it on my android emulator and on my computers jvm the code was: Set<Provider.Service> rar = new org.bouncycastle.jce.provider.BouncyCastleProvider().getServices(); Iterator<Provider.Service> ir = rar.iterator(); while(ir.hasNext()) System.out.println(ir.next().getAlgorithm()); On android I do not get any of the EC algorithms while ran normally on my computer it's fine. I'm also getting the following two errors when compiling for a lot of the bouncy castle classes: 01-07 17:17:42.548: INFO/dalvikvm(1054): DexOpt: not resolving ambiguous class 'Lorg/bouncycastle/asn1/ASN1Encodable;' 01-07 17:17:42.548: DEBUG/dalvikvm(1054): DexOpt: not verifying 'Lorg/bouncycastle/asn1/ess/OtherSigningCertificate;': multiple definitions What am I doing wrong?

    Read the article

  • Unable to run WCAT against DotNetNuke with NTLM authentication

    - by David Neale
    I have a ubr file setup to stress test an internal DotNetNuke site with WCAT: transaction { id = "Intranet Home Page"; weight = 1000; cookies{clear = true;} sleep{delay = rand("1","500");} request { url = "/"; statuscode = 401; } request { url = "/"; authentication = ntlm; username = "mydomain\\accountname"; password = "password"; statuscode = 200; } close{ method = reset;} } When running this (wcat.wsf -run -clients localhost -s myserver -t test.ubr -f settings.ubr -x) I simply get lots of error 500s: 2010-03-08 10:29:31 192.168.11.239 GET / - 80 - 192.168.52.139 - 401 2 2148074254 2010-03-08 10:29:31 192.168.11.239 GET / - 80 - 192.168.52.139 - 401 1 0 2010-03-08 10:29:31 192.168.11.239 GET /Default.aspx - 80 mydomain\myaccount 192.168.52.139 - 500 0 0 DNN is reporting these errors as: AssemblyVersion: 5.2.3 PortalID: 0 PortalName: My Company UserID: -1 UserName: ActiveTabID: 39 ActiveTabName: Home RawURL: /Default.aspx AbsoluteURL: /Default.aspx AbsoluteURLReferrer: UserAgent: DefaultDataProvider: DotNetNuke.Data.SqlDataProvider, DotNetNuke.SqlDataProvider ExceptionGUID: 28d8821f-1ef2-41db-8a65-d33e97a69130 InnerException: *Unhandled Error:* FileName: FileLineNumber: 0 FileColumnNumber: 0 Method: DotNetNuke.Authentication.ActiveDirectory.HttpModules.AuthenticationModule.OnAuthenticateRequest StackTrace: Message: System.Exception: Unhandled Error: --- System.NullReferenceException: Object reference not set to an instance of an object. at DotNetNuke.Authentication.ActiveDirectory.HttpModules.AuthenticationModule.OnAuthenticateRequest(Object s, EventArgs e) at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) --- End of inner exception stack trace --- Source: Server Name: MYSERVER It seems to be losing the username somehow.

    Read the article

  • Updating Visual FoxPro from SQL Server

    - by David Stein
    I'm trying to update some simple Visual FoxPro tables with SQL Server. I've created a linked server with the following: sp_addlinkedserver @server = 'UTIL', @srvproduct = 'VFP', @provider = 'VFPOLEDB', @datasrc = 'L:\M2MDATA\Util\util.dbc' GO And the following works: select * from UTIL...utcomp However, I cannot use the following statement: update util...utcomp set fmaddress = '123 Elvis Dr.' where fcsqldb = 'M2MDATA01' I receive the error: OLE DB provider "VFPOLEDB" for linked server "util" returned message "Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.". Msg 7333, Level 16, State 2, Line 2 Cannot fetch a row using a bookmark from OLE DB provider "VFPOLEDB" for linked server "util". I have the latest version (9.0) installed so I should have the latest provider. Am I doing something wrong? Is it not possible to update VFP from SQL?

    Read the article

  • FPSE, folder permissions and SharePoint Designer

    - by David Lively
    All, A few of our internal users are editing one of our classic ASP sites (Not a SharePoint site) via Sharepoint Designer which I believe uses FrontPage Server Extensions. I would like to give a particular user author rights to a single folder - ie, /products and any items and folders it contains. Any suggestions?

    Read the article

  • CSS - margin and float property

    - by David Casillas
    1.- We have a div with static positioning. Inside we have a parragraph with a margin. The heigth of the div will be the parragraph without the margin 2.- We have a div with float:left. Inside we have a parragraph with a margin. The heigth of the div will be the parragraph plus its margin. What is the explanation of this? Here is the html code and the CSS code. And here is a link to the test site. http://prueba.davidcasillas.es/ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="es"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Untitled Document</title> <link href="index.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="nivel1"> <div id="nivel21"> <p>Este es el primer parrafo</p> </div> <div id="nivel22"> <p>Este es el primer parrafo</p> </div> </div> </body> </html> body { margin:0; padding:0; } #nivel1 { border:solid; border-color:#333; margin:0; background-color:#0F3; margin:2em; } #nivel21 { margin:2em; float:left; background-color:#C00; } #nivel22 { margin:2em; background-color:#FC0; }

    Read the article

  • CKEditor plugin to close editor

    - by David Lawson
    The problem with destroying the editor from within a plugin, is that certain code tries to use the editor after the destructive plugin code, when in fact the editor is no longer there, causing errors and instability. I have come up with the following code for a plugin which closes the editor using both async:true and setTimeout: var cancelAddCmd = { modes : { wysiwyg:1, source:1 }, async: true, exec : function( editor ) { if(confirm('Are you sure you want to cancel editing and discard all content?')) setTimeout(function() { editor.destroy(); }, 100); } }; The problem I see is that it uses a dodgy setTimout call that would likely have mixed results depending on the computer's speed of execution - 100ms might not have passed by the time it would be OK to destroy the editor. Is there a proper way to destroy the editor from within a plugin? Even with async: true; and no setTimeout errors are created. Maybe a possible solution would be to stop any existing/any more code related to the editor from running afterwards, if possible? I have tried using events, like on('afterCommandExec', function(){ editor.destroy(); }) and some other events, but that hasn't helped much... doesn't seem like there is an event for when the editor has jumped out of its stack call for handling the button. And there is no way to stop execution by disposing of the CKEditor instance more properly?

    Read the article

  • Problem with auto page break in iReport

    - by David Reniz
    Hi... I'm using iReport 3.7. I have a report with two subreports (order details and some selling statistics), and a grouping by seller. One subreport is located in the Detail band of the group, and the other one is in the group footer. What's really odd is that no matter how long the report is, when I export it to PDF it's always one page long. Is there something I'm missing? Thanks in advance.

    Read the article

  • WCF - Passing CurrentPrincipal in the Header

    - by David Ward
    I have a WCF service that needs to know the Principal of the calling user. In the constructor of the service I have: Principal = OperationContext.Current.IncomingMessageHeaders.GetHeader<MyPrincipal>("myPrincipal", "ns"); and in the calling code I have something like: using (var factory = new ChannelFactory<IMyService>(localBinding, endpoint)) { var proxy = factory.CreateChannel(); using (var scope = new OperationContextScope((IContextChannel)proxy)) { var customHeader = MessageHeader.CreateHeader("myPrincipal", "ns", Thread.CurrentPrincipal); OperationContext.Current.OutgoingMessageHeaders.Add(customHeader); newList = proxy.CreateList(); } } This all works fine. My question is, how can I avoid having to wrap all proxy method calls in the using (var scope...{ [create header and add to OperationContext]? Could I create a custom ChannelFactory that will handle adding the myPrincipal header to the operation context? Something like that would save a whole load of copy/paste which I'd rather not do but I'm not sure how to achieve it:) Thanks

    Read the article

  • How to mark that a lgpl library is modified

    - by David Göransson
    I am using an LGPL library in my code. For my needs, I need to modify the code in the library. How do I mark the jar file that it contains modified code? Some txt file in the jar? In that case, what do I write in the txt file? I will include in the license agreement that we are distributing a modified version of the jar, but my question is about marking the jar itself.

    Read the article

  • Setting width of UISegmentedControl after removing a segment

    - by David Foster
    I have a UISegmentedControl of width 280. In code, I need to remove the third segment, set the UISegmentedControl's width to 200 and then re-centralise. By configuring the springs and struts in IB, I have set the segmented control up such that when I set the width directly it will automatically re-centre. However, when setting the width in code, is it true I need to set it via -setFrame? If this is the case, then I also need to set its X origin, which renders my auto-centralising redundant. My code: [segmentedControl removeSegmentAtIndex:2 animated:NO]; [segmentedControl setFrame:CGRectMake(segmentedControl.frame.origin.x + ((segmentedControl.frame.size.width - TWO_SEGMENT_SEGMENTED_CONTROL_WIDTH) / 2), segmentedControl.frame.origin.y, TWO_SEGMENT_SEGMENTED_CONTROL_WIDTH, segmentedControl.frame.size.height)]; This works, but seems hugely overblown for my purposes. Is there really no simpler way to set solely the width of the control in code?

    Read the article

  • xCode "Property access results unused - getters should not be used for side effects"

    - by David DelMonte
    Hi all, I'm getting this warning when I'm calling a local routine. My code is this: -(void)nextLetter { // NSLog(@"%s", __FUNCTION__); currentLetter ++; if(currentLetter > (letters.count - 1)) { currentLetter = 0; } self.fetchLetter; } I'm getting the warning on the self.fetchLetter statement. That routine looks like this: - (void)fetchLetter { // NSLog(@"%s", __FUNCTION__); NSString *wantedLetter = [[letters objectAtIndex: currentLetter] objectForKey: @"langLetter"]; NSString *wantedUpperCase = [[letters objectAtIndex: currentLetter] objectForKey: @"upperCase"]; ..... } I prefer to fix warning messages, is there a better way to write this? Thanks!

    Read the article

  • Calling Web Page from Windows Service

    - by David Moorhouse
    I have a Windows 2008 server. This has an instance of IIS7 installed and a website, accessible only via an internal hostname defined in the the servers hosts file. e.g. the server IP is 10.0.6.11 and the hosts file contains an entry 10.0.6.11 hl7.ourname.org I would like to call a URL on the website, e.g "http://hl7.ourname.org/updatestatus" from a Windows service. I can call the web site from an instance of IE7 running on the server. However, if try to call it from a Windows service I get a "Socket Error # 10061 Connection refused." This looks like a permission issue. The service is running as "Network Service" ,but maybe I should be running as a different user. Thanks

    Read the article

  • Graph spacing algorithm

    - by David
    Hi, I am looking for an algorithm that would be useful for determining x y coordinates for a number objects to display on screen. Each object can be related to another object and there can be any number of relationships and there can be any number of these objects. There is no restriction on the overall size of area on which to display these object. I am writing this in php and would be looking to store the coordinates in an array.

    Read the article

  • Calculate Percentage help ORACLE L@@K

    - by DAVID
    Hi this code gives me employee salaries and manager salaries. SELECT E.EMP_FNAME AS MANAGER, E.EMP_SALARY, D.DEPT_NO, A.EMP_FNAME AS EMPLOYEE, A.EMP_SALARY FROM EMPLOYEE E, EMPLOYEE A, DEPARTMENT D WHERE E.EMP_NIN = A.EMP_MANAGER AND A.EMP_MANAGER = D.EMP_MANAGER; How can i only show the employees that have a salary within 10% of their manager salary?

    Read the article

  • Link List Problem,

    - by david
    OK i have a problem with a Link List program i'm trying to Do, the link List is working fine. Here is my code #include <iostream> using namespace std; struct record { string word; struct record * link; }; typedef struct record node; node * insert_Node( node * head, node * previous, string key ); node * search( node *head, string key, int *found); void displayList(node *head); node * delete_node( node *head, node * previous, string key); int main() { node * previous, * head = NULL; int found = 0; string node1Data,newNodeData, nextData,lastData; //set up first node cout <<"Depature"<<endl; cin >>node1Data; previous = search( head, node1Data, &found); cout <<"Previous" <<previous<<endl; head = insert_Node(head, previous, node1Data); cout <<"Depature inserted"<<endl; //insert node between first node and head cout <<"Destination"<<endl; cin >>newNodeData; previous = search( head, newNodeData, &found); cout <<"Previous" <<previous<<endl; head = insert_Node(head, previous, newNodeData); cout <<"Destinationinserted"<<endl; //insert node between second node and head cout <<"Cost"<<endl; cin >>newNodeData; previous = search( head, newNodeData, &found); cout <<"Previous" <<previous<<endl; head = insert_Node(head, previous, newNodeData); cout <<"Cost inserted"<<endl; cout <<"Number of Seats Required"<<endl; //place node between new node and first node cin >>nextData; previous = search( head, nextData, &found); cout <<"Previous" <<previous<<endl; head = insert_Node(head, previous, nextData); cout <<"Number of Seats Required inserted"<<endl; //insert node between first node and head cout <<"Name"<<endl; cin >>newNodeData; previous = search( head, newNodeData, &found); cout <<"Previous" <<previous<<endl; head = insert_Node(head, previous, newNodeData); cout <<"Name inserted"<<endl; //insert node between node and head cout <<"Address "<<endl; cin >>newNodeData; previous = search( head, newNodeData, &found); cout <<"Previous" <<previous<<endl; head = insert_Node(head, previous, newNodeData); cout <<"Address inserted"<<endl; //place node as very last node cin >>lastData; previous = search( head, lastData, &found); cout <<"Previous" <<previous<<endl; head = insert_Node(head, previous, lastData); cout <<"C"<<endl; displayList(head); char Ans = 'y'; //Delete nodes do { cout <<"Enter Keyword to be delete"<<endl; cin >>nextData; previous = search( head, nextData, &found); if (found == 1) head = delete_node( head, previous,nextData); displayList(head); cout <<"Do you want to Delete more y /n "<<endl; cin >> Ans; } while( Ans =='y'); int choice, i=0, counter=0; int fclass[10]; int coach[10]; printf("Welcome to the booking program"); printf("\n-----------------"); do{ printf("\n Please pick one of the following option:"); printf("\n 1) Reserve a first class seat on Flight 101."); printf("\n 2) Reserve a coach seat on Flight 101."); printf("\n 3) Quit "); printf("\n ---------------------------------------------------------------------"); printf("\nYour choice?"); scanf("%d",&choice); switch(choice) { case 1: i++; if (i <10){ printf("Here is your seat: %d " , fclass[i]); } else if (i = 10) { printf("Sorry there is no more seats on First Class. Please wait for the next flight"); } break; case 2: if (i <10){ printf("Here is your Seat Coach: %d " , coach[i]); } else if ( i = 10) { printf("Sorry their is no more Seats on Coach. Please wait for the next flight"); } break; case 3: printf("Thank you and goodbye\n"); //exit(0); } } while (choice != 3); } /******************************************************* search function to return previous position of node ******************************************************/ node * search( node *head, string key, int *found) { node * previous, * current; current = head; previous = current; *found = 0;//not found //if (current->word < key) move through links until the next link //matches or current_word > key while( current !=NULL) { //compare exactly if (key ==current->word ) { *found = 1; break; } //if key is less than word else if ( key < current->word ) break; else { //previous stays one link behind current previous = current; current = previous -> link; } } return previous; } /******************************************************** display function as used with createList ******************************************************/ void displayList(node *head) { node * current; //current now contains the address held of the 1st node similar //to head current = head; cout << "\n\n"; if( current ==NULL) cout << "Empty List\n\n"; else { /*Keep going displaying the contents of the list and set current to the address of the next node. When set to null, there are no more nodes */ while(current !=NULL) { cout << current->word<<endl; current = current ->link; } } } /************************************************************ insert node used to position node (i) empty list head = NULL (ii) to position node before the first node key < head->word (iii) every other position including the end of the list This is done using the following steps (a) Pass in all the details to create the node either details or a whole record (b) Pass the details over to fill the node (C) Use the if statement to add the node to the list **********************************************************/ node * insert_Node( node * head, node * previous, string key ) { node * new_node, * temp; new_node = new node; //create the node new_node ->word = key; new_node -> link = NULL; if (head == NULL || key < head->word ) //empty list { //give address of head to temp temp = head; //head now points to the new_node head = new_node; //new_node now points to what head was pointing at new_node -> link = temp; } else { //pass address held in link to temp temp = previous-> link; //put address of new node to link of previous previous -> link = new_node; //pass address of temp to link of new node new_node -> link = temp; } return head; } node * delete_node( node *head, node * previous, string key) { /* this function will delete a node but will not return its contents */ node * temp; if(key == head->word) //delete node at head of list { temp = head; //point head at the next node head = head -> link; } else { //holds the address of the node after the one // to be deleted temp = previous-> link; /*assign the previous to the address of the present node to be deleted which holds the address of the next node */ previous-> link = previous-> link-> link; } delete temp; return head; }//end delete The problem i have is when i Enter in the Number 2 in the Node(Seats) i like to get a Counter Taken 2 off of 50, some thing like what i have here enter code here int choice, i=0, counter=0; int fclass[10]; int coach[10]; printf("Welcome to the booking program"); printf("\n-----------------"); do{ printf("\n Please pick one of the following option:"); printf("\n 1) Reserve a first class seat on Flight 101."); printf("\n 2) Reserve a coach seat on Flight 101."); printf("\n 3) Quit "); printf("\n ---------------------------------------------------------------------"); printf("\nYour choice?"); scanf("%d",&choice); switch(choice) { case 1: i++; if (i <10){ printf("Here is your seat: %d " , fclass[i]); } else if (i = 10) { printf("Sorry there is no more seats on First Class. Please wait for the next flight"); } break; case 2: if (i <10){ printf("Here is your Seat Coach: %d " , coach[i]); } else if ( i = 10) { printf("Sorry their is no more Seats on Coach. Please wait for the next flight"); } break; case 3: printf("Thank you and goodbye\n"); //exit(0); } } while (choice != 3); How can i get what the User enters into number of Seats into this function

    Read the article

  • How do I keep a CALayer, sublayer of a CATiledLayer, from changing it's scale after a zoom ?

    - by David
    I have a CATiledLayer that is used to display a PDF page (this CATiledLayer is the layer type of my UIView which is a subview of a UIScrollView). I want to add overlay markers on this page. So I add a sublayer to my CATiledLayer. This sublayer again hosts the different marker's layers and acts as a grouping layer. So graphically, I have: (keep in mind that I have multiple markers which are CALayers also, this is ascii art after all) pdf page (CATiledLayer) ---------------------- | CALayer | | +---------+ | | | +----+ | | | | |mker| | | | | +----+ | | | +---------+ | | | ---------------------- I have set up the canonical drawLayer:inContext: in my view for drawing the pdf. When I zoom to have more detail, the pdf gets rendered correctly, but the markers get scaled. No matter what I do to the bounds of the CALayer, my markers always become bigger and appear jagged. I would like to have the markers always the same size, as when they were initialized and first shown when the view was drawn. Is this possible ? or am I using a wrong approach ? Should I do special drawing for my contained CALayer in the drawLAyer:inContext: message ? As you see, there are things that I am missing to resolve my problem. Thank you for any help you provide.

    Read the article

  • How do I change apache2 DocumentRoot (default snow leopard install) and not get "You don't have perm

    - by David Peek
    I'm trying to point DocumentRoot at a directory in my user folder. While I can happily point DocumentRoot at /Library/WebServer/Documents and ~/Sites I keep getting "You don't have permission to access / on this server." when I point it anywhere else. OK, I just found a solution mid-question (stack overflow is just that good) by changing the user/group apache runs under to myuser/admin. I'm sure there must be a better way though. Surely some kind of permissions magic on the directory I'm pointing at?

    Read the article

  • Jquery using append with effects

    - by David King
    how can I use .append with effects like show('slow') having effects on append doesnt seems to work at all. and it give results as normal show() no transitions, no animations. How Can I append one div to another. and have a slideDown or Show('slow') effect on it?

    Read the article

  • StringTemplate Variable with Object Properties

    - by David Higgins
    I am starting to use StringTemplate for the first time, and am stuck trying to figure out how to get StringTemplate to do something like the following: article.st $elemenets:article/elements()$ article/elements.st $if($it.is_type)$ $it:article/type()$ $elseif($it.is_type2)$ $it:article/type2()$ // also tried: $it.value:article/type2()$, same result $endif$ article/type.st <type>$it.value$</type> article/type2.st <h1>$it.value.title</h1> <type2>$it.value.text</type2> program.cs StringTemplateGroup group = new StringTemplateGroup("article", "Templates"); StringTemplate template = group.GetInstanceOf("Article"); template.SetAttribute("elements", new Element() { is_type = true, value = "<p>Hello Text</p>" }); template.SetAttribute("elements", new Element() { is_type2 = true, value = new { title = "Type 2 Title", text = "Type2 Text" } }); return template.ToString(); Problem here is ... the if(it.is_type) works fine, and the article/type.st works perfectly. However, when I pass an object to the value property for 'Element' I get this error: Class ClassName has no such attribute: text in template context [Article article/element elseif(it.is_type2)_subtemplate article/type2] So - my question is, how do i access the properties/fields of an object, within an object using StringTemplate?

    Read the article

< Previous Page | 77 78 79 80 81 82 83 84 85 86 87 88  | Next Page >