Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Devin Bost 37 posts 78 karma points c-trib
    Mar 14, 2014 @ 08:16
    Devin Bost
    0

    Vanishing JQuery? (Literally not detected by browser.)

    Hi,

    I am using Umbraco 7.0.3. I am encountering the strangest problem ever. I have been trying to insert a particular chunk of JQuery into my site to process the data from a set of API controllers that I recently built.

    I have tried nearly every possible way to insert this code (or variations of it) into my site, but no matter where or how I put the code in my page, it disappears during runtime (i.e. when I render the page in any browser.). So, it's not that the data is disappearing from the application. Rather, for some reason, it seems to be getting stripped out during the rendering process. Even when I run the browser profilers or tools to trace the activity, there is no sign that the code even existed. No network calls, no errors, no related tags, ... nothing.

    Even if it was the JQuery, there should be at least some trace of its existence during rendering, right?

    I am not having issues with anything else rendering or loading. Will somebody please take a look at this? I need to know if I should check myself in at a local psych hospital.

    I found some interesting entries in the log. Here is that:

    2014-03-13 23:04:06,613 [18] INFO  Umbraco.Core.PluginManager - [Thread 1] Determining hash of code files on disk
    2014-03-13 23:04:06,650 [18] INFO  Umbraco.Core.PluginManager - [Thread 1] Hash determined (took 35ms)
    2014-03-13 23:04:06,677 [18] INFO  Umbraco.Core.PluginManager - [Thread 1] Starting resolution types of umbraco.interfaces.IApplicationStartupHandler
    2014-03-13 23:04:07,078 [18] INFO  Umbraco.Core.PluginManager - [Thread 1] Completed resolution of types of umbraco.interfaces.IApplicationStartupHandler, found 35 (took 400ms)
    2014-03-13 23:04:07,192 [18] INFO  Umbraco.Core.PluginManager - [Thread 1] Starting resolution types of Umbraco.Core.PropertyEditors.IPropertyEditorValueConverter
    2014-03-13 23:04:07,222 [18] INFO  Umbraco.Core.PluginManager - [Thread 1] Completed resolution of types of Umbraco.Core.PropertyEditors.IPropertyEditorValueConverter, found 0 (took 29ms)
    2014-03-13 23:04:07,222 [18] INFO  Umbraco.Core.PluginManager - [Thread 1] Starting resolution types of Umbraco.Core.PropertyEditors.IPropertyValueConverter
    2014-03-13 23:04:07,268 [18] INFO  Umbraco.Core.PluginManager - [Thread 1] Completed resolution of types of Umbraco.Core.PropertyEditors.IPropertyValueConverter, found 15 (took 46ms)
    2014-03-13 23:04:07,294 [18] INFO  Umbraco.Core.PluginManager - [Thread 1] Starting resolution types of Umbraco.Web.Mvc.SurfaceController
    2014-03-13 23:04:07,332 [18] INFO  Umbraco.Core.PluginManager - [Thread 1] Completed resolution of types of Umbraco.Web.Mvc.SurfaceController, found 4 (took 37ms)
    2014-03-13 23:04:07,332 [18] INFO  Umbraco.Core.PluginManager - [Thread 1] Starting resolution types of Umbraco.Web.WebApi.UmbracoApiController
    2014-03-13 23:04:07,374 [18] INFO  Umbraco.Core.PluginManager - [Thread 1] Completed resolution of types of Umbraco.Web.WebApi.UmbracoApiController, found 31 (took 41ms)
    2014-03-13 23:04:07,385 [18] INFO  Umbraco.Core.PluginManager - [Thread 1] Starting resolution types of Umbraco.Core.Media.IThumbnailProvider
    2014-03-13 23:04:07,423 [18] INFO  Umbraco.Core.PluginManager - [Thread 1] Completed resolution of types of Umbraco.Core.Media.IThumbnailProvider, found 3 (took 37ms)
    2014-03-13 23:04:07,423 [18] INFO  Umbraco.Core.PluginManager - [Thread 1] Starting resolution types of Umbraco.Core.Media.IImageUrlProvider
    2014-03-13 23:04:07,464 [18] INFO  Umbraco.Core.PluginManager - [Thread 1] Completed resolution of types of Umbraco.Core.Media.IImageUrlProvider, found 1 (took 41ms)
    2014-03-13 23:04:08,087 [18] INFO  Umbraco.Core.PluginManager - [Thread 1] Starting resolution types of Umbraco.Web.Trees.TreeController
    2014-03-13 23:04:08,120 [18] INFO  Umbraco.Core.PluginManager - [Thread 1] Completed resolution of types of Umbraco.Web.Trees.TreeController, found 4 (took 32ms)
    2014-03-13 23:04:08,154 [18] INFO  Umbraco.Core.PluginManager - [Thread 1] Starting resolution types of umbraco.interfaces.ITree
    2014-03-13 23:04:08,197 [18] INFO  Umbraco.Core.PluginManager - [Thread 1] Completed resolution of types of umbraco.interfaces.ITree, found 19 (took 43ms)
    2014-03-13 23:04:08,239 [18] INFO  Umbraco.Web.Search.ExamineEvents - [Thread 1] Initializing Examine and binding to business logic events
    2014-03-13 23:04:08,741 [18] INFO  Umbraco.Web.Search.ExamineEvents - [Thread 1] Adding examine event handlers for index providers: 3
    2014-03-13 23:04:08,743 [18] INFO  Umbraco.Core.PluginManager - [Thread 1] Starting resolution types of umbraco.interfaces.IApplication
    2014-03-13 23:04:08,794 [18] INFO  Umbraco.Core.PluginManager - [Thread 1] Completed resolution of types of umbraco.interfaces.IApplication, found 7 (took 50ms)
    2014-03-13 23:04:12,761 [18] INFO  umbraco.content - [Thread 15] Loading content from disk cache...
    2014-03-13 23:04:12,832 [18] INFO  Umbraco.Core.PluginManager - [Thread 15] Starting resolution types of Umbraco.Core.Persistence.Mappers.BaseMapper
    2014-03-13 23:04:12,894 [18] INFO  Umbraco.Core.PluginManager - [Thread 15] Completed resolution of types of Umbraco.Core.Persistence.Mappers.BaseMapper, found 20 (took 62ms)
    2014-03-13 23:04:13,561 [18] ERROR Umbraco.Core.PluginManager - [Thread 15] Error creating type Umbraco.Core.Models.PublishedContent.PublishedPropertyType+CompatConverter
    System.MissingMethodException: No parameterless constructor defined for this object.
       at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
       at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
       at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
       at System.Activator.CreateInstance(Type type, Boolean nonPublic)
       at System.Activator.CreateInstance(Type type)
       at Umbraco.Core.PluginManager.CreateInstances[T](IEnumerable`1 types, Boolean throwException)
    2014-03-13 23:04:13,566 [18] INFO  Umbraco.Core.PluginManager - [Thread 15] Starting resolution types of Umbraco.Core.PropertyEditors.IParameterEditor
    2014-03-13 23:04:13,651 [18] INFO  Umbraco.Core.PluginManager - [Thread 15] Completed resolution of types of Umbraco.Core.PropertyEditors.IParameterEditor, found 42 (took 84ms)
    2014-03-13 23:04:19,482 [18] INFO  Umbraco.Core.PluginManager - [Thread 15] Starting resolution types of Umbraco.Core.Macros.XsltExtensionAttribute
    2014-03-13 23:04:20,507 [18] INFO  Umbraco.Core.PluginManager - [Thread 15] Completed resolution of types of Umbraco.Core.Macros.XsltExtensionAttribute, found 1 (took 1024ms)
    2014-03-13 23:04:33,654 [18] INFO  Umbraco.Core.PluginManager - [Thread 10] Starting resolution types of Umbraco.Web.Trees.TreeController
    2014-03-13 23:04:33,654 [18] INFO  Umbraco.Core.PluginManager - [Thread 10] Completed resolution of types of Umbraco.Web.Trees.TreeController, found 4 (took 0ms)
    2014-03-13 23:04:34,718 [18] INFO  Umbraco.Core.PluginManager - [Thread 24] Starting resolution types of umbraco.interfaces.ITree
    2014-03-13 23:04:34,862 [18] INFO  Umbraco.Core.PluginManager - [Thread 24] Completed resolution of types of umbraco.interfaces.ITree, found 39 (took 143ms)
    2014-03-13 23:06:16,554 [18] INFO  Umbraco.Core.PluginManager - [Thread 23] Starting resolution types of umbraco.interfaces.ICacheRefresher
    2014-03-13 23:06:16,624 [18] INFO  Umbraco.Core.PluginManager - [Thread 23] Completed resolution of types of umbraco.interfaces.ICacheRefresher, found 18 (took 69ms)
    2014-03-13 23:25:03,858 [18] INFO  Umbraco.Core.PluginManager - [Thread 7] Starting resolution types of Umbraco.Core.PropertyEditors.IParameterEditor
    2014-03-13 23:25:03,858 [18] INFO  Umbraco.Core.PluginManager - [Thread 7] Completed resolution of types of Umbraco.Core.PropertyEditors.IParameterEditor, found 42 (took 0ms)
    2014-03-13 23:25:03,923 [18] INFO  Umbraco.Core.PluginManager - [Thread 7] Starting resolution types of umbraco.cms.businesslogic.macro.IMacroEngine
    2014-03-13 23:25:03,987 [18] INFO  Umbraco.Core.PluginManager - [Thread 7] Completed resolution of types of umbraco.cms.businesslogic.macro.IMacroEngine, found 2 (took 63ms)
    2014-03-13 23:25:05,637 [18] WARN  Umbraco.Web.Dictionary.DefaultCultureDictionary - [Thread 7] Error returning dictionary item 'Submit'. Exception: System.ArgumentException: No key Submit exists in dictionary
       at umbraco.cms.businesslogic.Dictionary.DictionaryItem..ctor(String key)
       at Umbraco.Web.Dictionary.DefaultCultureDictionary.get_Item(String key)
    2014-03-13 23:25:05,669 [18] WARN  Umbraco.Web.Dictionary.DefaultCultureDictionary - [Thread 7] Error returning dictionary item 'Previous'. Exception: System.ArgumentException: No key Previous exists in dictionary
       at umbraco.cms.businesslogic.Dictionary.DictionaryItem..ctor(String key)
       at Umbraco.Web.Dictionary.DefaultCultureDictionary.get_Item(String key)
    2014-03-13 23:25:05,712 [18] WARN  Umbraco.Web.Dictionary.DefaultCultureDictionary - [Thread 7] Error returning dictionary item 'Next'. Exception: System.ArgumentException: No key Next exists in dictionary
       at umbraco.cms.businesslogic.Dictionary.DictionaryItem..ctor(String key)
       at Umbraco.Web.Dictionary.DefaultCultureDictionary.get_Item(String key)
    2014-03-13 23:25:08,617 [18] WARN  Umbraco.Web.Dictionary.DefaultCultureDictionary - [Thread 7] Error returning dictionary item 'Submit'. Exception: System.ArgumentException: No key Submit exists in dictionary
       at umbraco.cms.businesslogic.Dictionary.DictionaryItem..ctor(String key)
       at Umbraco.Web.Dictionary.DefaultCultureDictionary.get_Item(String key)
    2014-03-13 23:25:08,644 [18] WARN  Umbraco.Web.Dictionary.DefaultCultureDictionary - [Thread 7] Error returning dictionary item 'Previous'. Exception: System.ArgumentException: No key Previous exists in dictionary
       at umbraco.cms.businesslogic.Dictionary.DictionaryItem..ctor(String key)
       at Umbraco.Web.Dictionary.DefaultCultureDictionary.get_Item(String key)
    2014-03-13 23:25:08,683 [18] WARN  Umbraco.Web.Dictionary.DefaultCultureDictionary - [Thread 7] Error returning dictionary item 'Next'. Exception: System.ArgumentException: No key Next exists in dictionary
       at umbraco.cms.businesslogic.Dictionary.DictionaryItem..ctor(String key)
       at Umbraco.Web.Dictionary.DefaultCultureDictionary.get_Item(String key)
    2014-03-13 23:25:40,310 [18] WARN  Umbraco.Web.Dictionary.DefaultCultureDictionary - [Thread 39] Error returning dictionary item 'Submit'. Exception: System.ArgumentException: No key Submit exists in dictionary
       at umbraco.cms.businesslogic.Dictionary.DictionaryItem..ctor(String key)
       at Umbraco.Web.Dictionary.DefaultCultureDictionary.get_Item(String key)
    2014-03-13 23:25:40,349 [18] WARN  Umbraco.Web.Dictionary.DefaultCultureDictionary - [Thread 39] Error returning dictionary item 'Previous'. Exception: System.ArgumentException: No key Previous exists in dictionary
       at umbraco.cms.businesslogic.Dictionary.DictionaryItem..ctor(String key)
       at Umbraco.Web.Dictionary.DefaultCultureDictionary.get_Item(String key)
    2014-03-13 23:25:40,403 [18] WARN  Umbraco.Web.Dictionary.DefaultCultureDictionary - [Thread 39] Error returning dictionary item 'Next'. Exception: System.ArgumentException: No key Next exists in dictionary
       at umbraco.cms.businesslogic.Dictionary.DictionaryItem..ctor(String key)
       at Umbraco.Web.Dictionary.DefaultCultureDictionary.get_Item(String key)
    2014-03-13 23:25:59,172 [18] INFO  umbraco.BusinessLogic.Log - [Thread 39] Redirected log call (please use Umbraco.Core.Logging.LogHelper instead of umbraco.BusinessLogic.Log) | Type: Login | User: 0 | NodeId: -1 | Comment: User dbost has logged in
    2014-03-13 23:25:59,209 [18] INFO  Umbraco.Web.Security.WebSecurity - [Thread 7] User Id: 0 logged in
    2014-03-13 23:25:59,275 [18] INFO  Umbraco.Core.PluginManager - [Thread 40] Starting resolution types of Umbraco.Web.Trees.TreeController
    2014-03-13 23:25:59,275 [18] INFO  Umbraco.Core.PluginManager - [Thread 40] Completed resolution of types of Umbraco.Web.Trees.TreeController, found 4 (took 0ms)
    2014-03-13 23:42:26,517 [18] INFO  Umbraco.Core.PluginManager - [Thread 1] Determining hash of code files on disk
    2014-03-13 23:42:26,553 [18] INFO  Umbraco.Core.PluginManager - [Thread 1] Hash determined (took 33ms)
    2014-03-13 23:42:26,572 [18] INFO  Umbraco.Core.PluginManager - [Thread 1] Starting resolution types of umbraco.interfaces.IApplicationStartupHandler
    2014-03-13 23:42:26,948 [18] INFO  Umbraco.Core.PluginManager - [Thread 1] Completed resolution of types of umbraco.interfaces.IApplicationStartupHandler, found 35 (took 375ms)
    2014-03-13 23:42:27,061 [18] INFO  Umbraco.Core.PluginManager - [Thread 1] Starting resolution types of Umbraco.Core.PropertyEditors.IPropertyEditorValueConverter
    2014-03-13 23:42:27,090 [18] INFO  Umbraco.Core.PluginManager - [Thread 1] Completed resolution of types of Umbraco.Core.PropertyEditors.IPropertyEditorValueConverter, found 0 (took 29ms)
    2014-03-13 23:42:27,091 [18] INFO  Umbraco.Core.PluginManager - [Thread 1] Starting resolution types of Umbraco.Core.PropertyEditors.IPropertyValueConverter
    2014-03-13 23:42:27,138 [18] INFO  Umbraco.Core.PluginManager - [Thread 1] Completed resolution of types of Umbraco.Core.PropertyEditors.IPropertyValueConverter, found 15 (took 47ms)
    2014-03-13 23:42:27,157 [18] INFO  Umbraco.Core.PluginManager - [Thread 1] Starting resolution types of Umbraco.Web.Mvc.SurfaceController
    2014-03-13 23:42:27,195 [18] INFO  Umbraco.Core.PluginManager - [Thread 1] Completed resolution of types of Umbraco.Web.Mvc.SurfaceController, found 4 (took 38ms)
    2014-03-13 23:42:27,196 [18] INFO  Umbraco.Core.PluginManager - [Thread 1] Starting resolution types of Umbraco.Web.WebApi.UmbracoApiController
    2014-03-13 23:42:27,240 [18] INFO  Umbraco.Core.PluginManager - [Thread 1] Completed resolution of types of Umbraco.Web.WebApi.UmbracoApiController, found 31 (took 44ms)
    2014-03-13 23:42:27,246 [18] INFO  Umbraco.Core.PluginManager - [Thread 1] Starting resolution types of Umbraco.Core.Media.IThumbnailProvider
    2014-03-13 23:42:27,282 [18] INFO  Umbraco.Core.PluginManager - [Thread 1] Completed resolution of types of Umbraco.Core.Media.IThumbnailProvider, found 3 (took 35ms)
    2014-03-13 23:42:27,282 [18] INFO  Umbraco.Core.PluginManager - [Thread 1] Starting resolution types of Umbraco.Core.Media.IImageUrlProvider
    2014-03-13 23:42:27,323 [18] INFO  Umbraco.Core.PluginManager - [Thread 1] Completed resolution of types of Umbraco.Core.Media.IImageUrlProvider, found 1 (took 40ms)
    2014-03-13 23:42:27,943 [18] INFO  Umbraco.Core.PluginManager - [Thread 1] Starting resolution types of Umbraco.Web.Trees.TreeController
    2014-03-13 23:42:27,985 [18] INFO  Umbraco.Core.PluginManager - [Thread 1] Completed resolution of types of Umbraco.Web.Trees.TreeController, found 4 (took 42ms)
    2014-03-13 23:42:28,013 [18] INFO  Umbraco.Core.PluginManager - [Thread 1] Starting resolution types of umbraco.interfaces.ITree
    2014-03-13 23:42:28,057 [18] INFO  Umbraco.Core.PluginManager - [Thread 1] Completed resolution of types of umbraco.interfaces.ITree, found 19 (took 43ms)
    2014-03-13 23:42:28,096 [18] INFO  Umbraco.Web.Search.ExamineEvents - [Thread 1] Initializing Examine and binding to business logic events
    2014-03-13 23:42:28,613 [18] INFO  Umbraco.Web.Search.ExamineEvents - [Thread 1] Adding examine event handlers for index providers: 3
    2014-03-13 23:42:28,616 [18] INFO  Umbraco.Core.PluginManager - [Thread 1] Starting resolution types of umbraco.interfaces.IApplication
    2014-03-13 23:42:28,667 [18] INFO  Umbraco.Core.PluginManager - [Thread 1] Completed resolution of types of umbraco.interfaces.IApplication, found 7 (took 51ms)
    2014-03-13 23:43:42,577 [18] INFO  umbraco.BusinessLogic.Log - [Thread 9] Redirected log call (please use Umbraco.Core.Logging.LogHelper instead of umbraco.BusinessLogic.Log) | Type: Login | User: 0 | NodeId: -1 | Comment: User dbost has logged in
    2014-03-13 23:43:42,582 [18] INFO  Umbraco.Core.PluginManager - [Thread 5] Starting resolution types of Umbraco.Core.Persistence.Mappers.BaseMapper
    2014-03-13 23:43:42,674 [18] INFO  Umbraco.Core.PluginManager - [Thread 5] Completed resolution of types of Umbraco.Core.Persistence.Mappers.BaseMapper, found 20 (took 92ms)
    2014-03-13 23:43:42,782 [18] INFO  Umbraco.Web.Security.WebSecurity - [Thread 5] User Id: 0 logged in
    2014-03-13 23:43:45,116 [18] INFO  Umbraco.Core.PluginManager - [Thread 7] Starting resolution types of umbraco.interfaces.ITree
    2014-03-13 23:43:45,170 [18] INFO  Umbraco.Core.PluginManager - [Thread 7] Completed resolution of types of umbraco.interfaces.ITree, found 39 (took 53ms)
    2014-03-13 23:44:41,447 [18] INFO  Umbraco.Core.PluginManager - [Thread 25] Starting resolution types of umbraco.cms.businesslogic.macro.IMacroEngine
    2014-03-13 23:44:41,507 [18] INFO  Umbraco.Core.PluginManager - [Thread 25] Completed resolution of types of umbraco.cms.businesslogic.macro.IMacroEngine, found 2 (took 60ms)
    2014-03-13 23:45:05,743 [18] INFO  Umbraco.Core.PluginManager - [Thread 28] Starting resolution types of umbraco.interfaces.ICacheRefresher
    2014-03-13 23:45:05,803 [18] INFO  Umbraco.Core.PluginManager - [Thread 28] Completed resolution of types of umbraco.interfaces.ICacheRefresher, found 18 (took 59ms)
    2014-03-13 23:45:32,817 [18] INFO  Umbraco.Core.PluginManager - [Thread 26] Starting resolution types of Umbraco.Core.PropertyEditors.IParameterEditor
    2014-03-13 23:45:32,905 [18] INFO  Umbraco.Core.PluginManager - [Thread 26] Completed resolution of types of Umbraco.Core.PropertyEditors.IParameterEditor, found 42 (took 87ms)
    2014-03-13 23:47:57,285 [18] INFO  umbraco.content - [Thread 41] Loading content from disk cache...
    2014-03-13 23:47:57,420 [18] ERROR Umbraco.Core.PluginManager - [Thread 41] Error creating type Umbraco.Core.Models.PublishedContent.PublishedPropertyType+CompatConverter
    System.MissingMethodException: No parameterless constructor defined for this object.
       at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
       at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
       at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
       at System.Activator.CreateInstance(Type type, Boolean nonPublic)
       at System.Activator.CreateInstance(Type type)
       at Umbraco.Core.PluginManager.CreateInstances[T](IEnumerable`1 types, Boolean throwException)
    2014-03-13 23:47:57,426 [18] INFO  Umbraco.Core.PluginManager - [Thread 41] Starting resolution types of Umbraco.Core.PropertyEditors.IParameterEditor
    2014-03-13 23:47:57,426 [18] INFO  Umbraco.Core.PluginManager - [Thread 41] Completed resolution of types of Umbraco.Core.PropertyEditors.IParameterEditor, found 42 (took 0ms)
    2014-03-13 23:48:10,346 [18] INFO  Umbraco.Core.Publishing.PublishingStrategy - [Thread 34] Content 'GetDrugAlternativeNames' with Id '2104' has been published.
    
  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Mar 14, 2014 @ 10:18
    Jan Skovgaard
    0

    Hi Devin

    Could you explain a bit about what it is you're trying to do in your code? And would you mindt sharing the actual code? I think that would make it a bit easier to help you out.

    /Jan

  • Devin Bost 37 posts 78 karma points c-trib
    Mar 14, 2014 @ 23:05
    Devin Bost
    0

    Hi Jan,

    Thanks for the quick answer. I'm trying to consume a content API with JQuery to render the data. (I eventually want to use AngularJS to display a grid.)

    Here is the link I am using to connect to the web service: http://localhost:1953/umbraco/api/DrugInteractionsTwoDrugsApi/GetDrugAlternativeNames (I have not yet published this service because I want to secure it first.)

    Here is a sample of the output from that page:

    <ArrayOfudfGetDrugAlternativeNames_Result xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/DrugInteractionsChecker_v1_0_0.Models">
    <udfGetDrugAlternativeNames_Result>
    <Brand_Mixtures/>
    <Dosing_Guideline>No</Dosing_Guideline>
    <Generic_Names>
    Beta-Pebg,Beta-Phenethybiguanide,Beta-Phenethylbiguanide,Fenformin,Fenformina [INN-Spanish],N-Phenethylbiguanide Hydrochloride,PEDG,Phenethylbiguanide Hydrochloride,Phenethyldiguanide,Phenformin HCl,Phenformin Hydrochloride,Phenformine,Phenformine HCl,Phenformine [INN-French],Phenforminum [INN-Latin],Phenoformine Hydrochloride,Phenylethylbiguanide
    </Generic_Names>
    <Name>phenformin</Name>
    <SMILES>c1ccc(cc1)CCNC(=N)NC(=N)N</SMILES>
    <Trade_Names>
    Azucaps,Cronoformin,D Bretard,DB Comb,DB-Retard,DBI,DBI Monohydrochloride,Debeone,Debinyl,Diabis,Dibein,Dibiraf,Dibotin,Dipar,Feguanide,Fenfoduron,Fenormin,Glukopostin,Glyphen,Insoral,Lentobetic,Meltrol,Meltrol-50,Normoglucina,Phenformix,Retardo
    </Trade_Names>
    <Type>Drug/Small Molecule</Type>
    </udfGetDrugAlternativeNames_Result>
    

    ... Here is the JQuery that I'm using to connect to the API controller:

    $(document).ready(function() {
        // Send an AJAX request
        $.getJSON('/umbraco/api/DrugInteractionsTwoDrugsApi/GetDrugAlternativeNames')
            .done(function(data) {
                // On success, 'data' contains a list of products.
                $.each(data, function(key, item) {
                    $('<li>', { text: formatItem(item) }).appendTo($('#containsData'));
                });
            });
    });
    
    function formatItem(item) {
        return item.name + item.drugGenericName1 + item; // please replace with correct parameters.
    
    }
    

    Here is the code for my inner-most template:

    @inherits Umbraco.Web.Mvc.UmbracoTemplatePage
    @{
        Layout = "MainWrapper.cshtml";
    }
    <div class="main-wrapper-style3">
        <div class="inner">
            <div class="container">
                <div class="row">
                    <div class="9u skel-cell-mainContent">
                        <div class="content content-left">
                            <!-- Content -->
                            <article class="is-page-content">
                                <header>
                                    <h2>@Umbraco.Field("title")</h2>
                                </header>
                                <section>
                                    <div id="containsData">
    
                                    </div>
                                    @*@if (string.IsNullOrWhiteSpace(CurrentPage.Image) == false)
                                    {
                                        <span class="image image-full"><img src="@CurrentPage.Image" alt="" /></span>
                                    }*@
    
                                    @CurrentPage.BodyText
                                </section>
                            </article>
                            <!-- /Content -->
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    

    (You can see that I have the appropriate ID for the div tag in my innermost element. You can ignore the @RenderBody portion. (I am not using @RenderBody for anything significant yet on this document.)) You will also see that this template is inheriting from the WebServicesTemplate (through one intermediate step). I am referencing the JavaScript tag in the header of the WebServicesTemplate. Here is the code for the WebServicesTemplate:

    @inherits Umbraco.Web.Mvc.UmbracoTemplatePage
    @{
        Layout = null;
        // If the editor has not explicitly provided the "Page title" property page 
        // then just show the name of the page otherwise show the provided title
        var pageTitle = string.IsNullOrWhiteSpace(CurrentPage.Title)
            ? CurrentPage.Name
            : CurrentPage.Title;    
    }
    <!DOCTYPE HTML>
    <html>
        <head>
            <title>@Umbraco.Field("title", altFieldAlias: "pageName") | @Umbraco.Field("siteName", recursive: true)</title>
            <meta http-equiv="content-type" content="text/html; charset=utf-8" />
            <meta name="description" content="" />
            <meta name="keywords" content="" />
            <script type="text/javascript" src="~/scripts/FormatDrugsAlternateNamesData.js"></script>
            @{ Html.RenderPartial("umbMasterMetaData"); }
        </head>
        <body class="homepage">
    
        @RenderBody()
    
        </body>
    </html>
    
  • Devin Bost 37 posts 78 karma points c-trib
    Mar 14, 2014 @ 23:07
    Devin Bost
    0

    Here is the JavaScript file that contains the JQuery I referenced from my previous post. (You see it at the bottom.) Screenshot of JavaScript File

  • Devin Bost 37 posts 78 karma points c-trib
    Mar 14, 2014 @ 23:14
    Devin Bost
    0

    Here is a screenshot of the resulting page. I have assigned GetDrugsAlternativeTemplate to a document type called "InteractiveQuery". I then created a content object called "GetDrugAlternativeNames," of the InteractiveQuery document type, and I gave this content object the GetDrugsAlternativeTemplate. The link to this document takes me here: http://localhost:1953/getdrugalternativenames/ You will see that it contains no data:

    Screenshot of resulting web page

    What is even stranger is what we see when we inspect the code in the developer tools: enter image description here

    You will see that the JQuery reference has completely vanished.

  • Devin Bost 37 posts 78 karma points c-trib
    Mar 14, 2014 @ 23:18
    Devin Bost
    0

    For what value it may be worth, here is the code for the controller that I am using for the UmbracoApiController:

    using DrugInteractionsChecker_v1_0_0.Models;
    using Umbraco.Web.WebApi;
    
    namespace DrugInteractionsChecker_v1_0_0.Controllers
    {
        public class DrugInteractionsTwoDrugsApiController : UmbracoApiController
        {
    
            //public IQueryable<DbDataRecord> GetListOfInteractions(string drug1, string drug2)
            public IEnumerable<udfGetDrugAlternativeNames_Result> GetDrugAlternativeNames()
            {
                using (var context = new DrugGenomicsEntities())
                {
                    foreach (var udfGetDrugAlternativeNames in context.udfGetDrugAlternativeNames())
                    {
                        yield return udfGetDrugAlternativeNames;
                    }
                }
            }
        }
    }
    

    I am using Entity Framework 6 to call a Table-Valued User Defined Function (UDF) from a database running SQL Server Enterprise 2012.

    I also tried using a few different techniques to represent the view, and all of them resulted in the same output.

Please Sign in or register to post replies

Write your reply to:

Draft