+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Server Error in '/' Application

Server Error in '/' Application

4 posts, 0 answered
  1. David
    David avatar
    114 posts
    Registered:
    19 Jul 2012
    05 May 2015
    Link to this post

    I'm getting the following error when trying to add in a javascript file using the embedded approach.  Whatever I put into AssemblyInfo="Anything", (the example is setting AssembyInfo="SitefinityWebApp.JS, SitefinityWebApp") I get the following error:

     

    Server Error in '/' Application.

    Type "SitefinityWebApp.JS, SitefinityWebApp" cannot be resolved.
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.ArgumentException: Type "SitefinityWebApp.JS, SitefinityWebApp" cannot be resolved.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
    Stack Trace:

    [ArgumentException: Type "SitefinityWebApp.JS, SitefinityWebApp" cannot be resolved.] Telerik.Sitefinity.Utilities.TypeConverters.TypeResolutionService.GetType(String name, Boolean throwOnError, Boolean ignoreCase) +1242 Telerik.Sitefinity.Web.UI.ResourceLinks.RegisterResource(ResourceFile resource) +107 Telerik.Sitefinity.Web.UI.ResourceLinks.CreateChildControls() +541 System.Web.UI.Control.EnsureChildControls() +83 System.Web.UI.Control.PreRenderRecursiveInternal() +42 System.Web.UI.Control.PreRenderRecursiveInternal() +155 System.Web.UI.Control.PreRenderRecursiveInternal() +155 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +974​

     

    Here is the code I am using:

    <%@ Register Assembly="Telerik.Sitefinity" Namespace="Telerik.Sitefinity.Web.UI" TagPrefix="sf" %>

    <sf:ResourceLinks ID="ResourceLinks1" runat="server">
    <sf:ResourceFile JavaScriptLibrary="JQuery"></sf:ResourceFile>
    </sf:ResourceLinks>

    <sf:ResourceLinks ID="ResourceLinks2" runat="server">
    <sf:ResourceFile Name="SitefinityWebApp.JS.hello.js" AssemblyInfo="SitefinityWebApp.JS, SitefinityWebApp" Static="true"></sf:ResourceFile>

  2. David
    David avatar
    114 posts
    Registered:
    19 Jul 2012
    07 May 2015 in reply to David
    Link to this post
    I've now done this using the Code Behind method outlined in the Sitefinity manual.  I think this is overkill just to add some javascript.  Would still like to know how to use the markup method - if anyone has actually done this - please let me know how.
  3. Tim
    Tim avatar
    258 posts
    Registered:
    22 Jun 2011
    07 May 2015 in reply to David
    Link to this post

    David,

    This is how I've accomplished it in the past:

    <sf:ResourceLinks ID="ResourcesLinks1" UseEmbeddedThemes="True" runat="server">
        <sf:ResourceFile JavaScriptLibrary="JQuery" />
        <sf:ResourceFile Name="SitefinityWebApp.JS.hello.js" AssemblyInfo="SitefinityWebApp.SomeControlInTheNamespace, SitefinityWebApp" Static="True"></sf:ResourceFile>
    </sf:ResourceLinks>

    And then, making sure that I have the resource set to "Embedded Resource" and referenced in AssemblyInfo.cs, like so:

    [assembly: WebResource("SitefinityWebApp.JS.hello.js", "application/x-javascript")]

  4. David
    David avatar
    114 posts
    Registered:
    19 Jul 2012
    08 May 2015 in reply to Tim
    Link to this post

    Thanks Tim,

    I'm going to stick with the code behind now I've gone and done it for now.  If I get sometime I will come back and change this around though as I much prefer this method.  I hope ​Sitefinity update the manual to this example since this is how Sitefinity originally sets up the project.

4 posts, 0 answered