Errors when attempting to follow simple Telerik tutorial

8 posts, 0 answers
  1. SIT
    SIT avatar
    12 posts
    Member since:
    Mar 2009

    Posted 18 Mar 2009 Link to this post

    I am attempting to follow the tutorial found here;

    http://www.telerik.com/help/aspnet-ajax/create-ajax-enabled-sharepoint-webpart-radcontrols.html

    When I attempt to put the following code in the web.config:

    <add verb="*" path="Telerik.Web.UI.WebResource.axd"
    type="Telerik.Web.UI.WebResource, Telerik.Web.UI" />

    My sharepoint site does not load and I get an error:

    Server Error in '/' Application.

    I already have a regular scriptmanager loading so can I just use that instead of the RadScriptManager?

    This was my assumption so I proceeded with the tutorial without having the above <add verb> tag in the web.confg file.

    When I created the webpart and entered the code from the tutorial, I got the following error:

    "The control collection cannot be modified during DataBind, Init, Load, PreRender, or Unload phases."

    Also, the tutorial says nothing about how to add the Telerik.Web.UI; reference.  I had to add it by copying the Telerik.Web.UI.dll file from a different project and then browsing the filesystem and selecting theTelerik.Web.UI.dll file.  What is the proper way to add a reference to the Telerik.Web.UI.dll file?









  2. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 18 Mar 2009 Link to this post

    Hello Dave,

    In sharepoint you may need the fully qualified name (with version and public key token) when registering the http handler of RadScriptManager.

    Yes, you can use ScriptManager - RadControls will work with either ScriptManager or RadScriptManager.

    It is up to you how to add the assembly reference. It should not matter as long as Telerik.Web.UI.dll is correctly deployed along with the WebPart (preferably in GAC).

    The error you are getting is strange. Could you send us the source of your webpart? You can open a support ticket to do so.

    I hope this helps,
    Albert
    the Telerik team


    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.

  3. SIT
    SIT avatar
    12 posts
    Member since:
    Mar 2009

    Posted 18 Mar 2009 Link to this post

    edited post.  see next post
  4. SIT
    SIT avatar
    12 posts
    Member since:
    Mar 2009

    Posted 18 Mar 2009 Link to this post

    I don't know how I got the error "The control collection cannot be modified during DataBind, Init, Load, PreRender, or Unload phases." but it is not appearing anymore.  However, I still cannot get the example to work.

    I am simply trying to get the following sample to work:

    http://www.telerik.com/help/aspnet-ajax/create-ajax-enabled-sharepoint-webpart-radcontrols.html

    Here is what I have done so far:

    I put the following in the web.config:

     <SafeControl Assembly="Telerik.Web.UI, Version=2009.1.311.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" Namespace="Telerik.Web.UI" TypeName="*" Safe="True" />
          <SafeControl Assembly="Telerik.Web.UI, Version=2009.1.311.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" Namespace="Telerik.Web.Design" TypeName="*" Safe="True" />

    I installed Telerik.Web.UI.dll with the following command:

    "\Program Files\Microsoft SDKs\Windows\v6.0A\bin\gacutil" /i "C:\Users\Administrator\Documents\Visual Studio 2008\Projects\WebApplication2\bin\Telerik.Web.UI.dll"

    ASP.NET and AJAX are setup and tested to be working properly.

    I tried putting the following in the web.config:

     <add verb="*" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource, Telerik.Web.UI" />

    When I enter the above in the web.config, I get the error "Server Error in '/' Application." when I access any page on my sharepoint site.  The event viewer contains additional information about the error.  " Exception message: Could not load file or assembly 'Telerik.Web.UI' or one of its dependencies. The system cannot find the file specified. (C:\inetpub\wwwroot\wss\VirtualDirectories\80\web.config line 112) "

    To proceed, I removed the "add verb" entry from line 112 and then proceeded with the example (not using the radscriptmanager).

    When I compile the linked example entered exactly as specified, I get the following error:

    Error    1    The type 'System.Web.UI.IScriptControl' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.    C:\Users\Administrator\Documents\Visual Studio 2008\Projects\WebPart7\WebPart1\WebPart7.cs    63    4    WebPart7

    If I add the reference to System.Web.Extensions v3.5.0.0, the web part compiles and I can deploy it but when I open the web part page from the web browser,  I get the error "An unexpected error has occurred"

    If I remove the code that adds the telerik controls to the panel, then the webpart page loads and the label is displayed.

    One more note, In the linked example, there is a link to a blog post for setting up ASP.NET and AJAX.  In that post, entries are made into the web.config (which I had previously entered) that reference System.Web.Extensions Version=1.0.61025.0 but the telerik controls require version 3.5.0.0.  Not sure if this is related to the "unexpected error".  I debugged the web part and no error is displayed in any lines of code when stepping line by line.  The error is displayed only after the web part has processed all code.  There are no error messages in the event viewer log.

    Is there a complete example for adding telerik controls to a web part that contains complete instructions?

    I am currently evaluating the Telerik ASP.NET AJAX controls and I am ready to purchase it.  I just need to be able to verify that I can successfully host the controls in a sharepoint web part.









  5. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 19 Mar 2009 Link to this post

    Hi Dave,

    Indeed the instructions in that blog post are for deploying ASP.NET Ajax 1.0. Since you are using .NET 3.5 you don't need to install and deploy ASP.NET Ajax 1.0. You can find MOSS deployment instructions for .NET 3.5 in this help topic. Make sure you have followed the steps from that page not the ones from the ASP.NET Ajax 1.0 page.

    For the http handler registration you can try the following:

    <add verb="*" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource, Telerik.Web.UI, Version=2009.1.311.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" />

    For troubleshooting you can enable stacktrace for your MOSS server from the web.config. This way you would get more developer friendly error messages.

    I hope this helps,
    Albert
    the Telerik team


    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  6. SIT
    SIT avatar
    12 posts
    Member since:
    Mar 2009

    Posted 19 Mar 2009 Link to this post

    How would I go about using the Telerik controls with ASP.NET 1.0?
  7. SIT
    SIT avatar
    12 posts
    Member since:
    Mar 2009

    Posted 19 Mar 2009 Link to this post

    When I switched my project to .net 2.0, I get the following compile error:

    Error    1    Assembly 'Telerik.Web.UI, Version=2009.1.311.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4' uses 'System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' which has a higher version than referenced assembly 'System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'    c:\Users\Administrator\Documents\Visual Studio 2008\Projects\WebPart7\bin\Debug\Telerik.Web.UI.dll    WebPart7

    is there a version of Telerik.Web.UI.dll that works with .net 2.0?


  8. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 19 Mar 2009 Link to this post

    Hello Dave,

    You need the 2009.1.311.20 version of the Telerik.Web.UI.dll assembly. It is located in the bin folder of your RadControls installation.

    Kind regards,
    Albert
    the Telerik team


    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top