This is a migrated thread and some comments may be shown as answers.

How to usetelerik contol as a web part in share point.

1 Answer 144 Views
Sharepoint Integration
This is a migrated thread and some comments may be shown as answers.
atul
Top achievements
Rank 1
atul asked on 10 Sep 2008, 03:28 PM

Hi All,

I am new in share point and telerik control.

I want to add telerik menu control as a web part in share point site. I want some help form any share point expert J

Below is my c# code.

 

using System;

using System.Runtime.InteropServices;

using System.Web.UI;

using System.Web.UI.WebControls.WebParts;

using System.Xml.Serialization;

using Microsoft.SharePoint;

using Microsoft.SharePoint.WebControls;

using Microsoft.SharePoint.WebPartPages;

using Telerik.Web.UI;

namespace DynamicMenuWebPart

{

    [Guid("4fe5b8a3-f60b-4f96-ae66-f17512972f67")]

    public class DynamicMenuWebPart : System.Web.UI.WebControls.WebParts.WebPart

    {

        public DynamicMenuWebPart()

        {

            this.ExportMode = WebPartExportMode.All;

        }

 

 

        protected override void Render(HtmlTextWriter writer)

        {

            base.Render(writer);

            RadMenu menu = new RadMenu();

            menu.ID = "menu";

            RadMenuItem item = new RadMenuItem("Item1");

            menu.Items.Add(item);

 

            this.Controls.Add(menu);

        }

 

 

        protected override void CreateChildControls()

        {

            base.CreateChildControls();

 

        }

       

    }

}

 

Also added assembly ref of Telerik.Web.UI.dll, System.Web.Extensions.dll in project

In my site web config I added entries for telerik contol are below in

<SafeControls>

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

   

 

Then I build code and run code with no error. Then when I add web part in my share point page

I get error below

“The "DynamicMenuWebPart" Web Part appears to be causing a problem. The control with ID 'menu' requires a ScriptManager on the page. The ScriptManager must appear before any controls that need it.

Web Parts Maintenance Page: If you have permission, you can use this page to temporarily close Web Parts or remove personal settings. For more information, contact your site administrator.

Troubleshoot issues with Windows SharePoint Services.

 

Please help me to solve the problem.Please reply me how to use telerik control as web part in share point page.

1 Answer, 1 is accepted

Sort by
0
Sebastian
Telerik team
answered on 11 Sep 2008, 07:20 AM
Hi atul,

As the exception states, you need to add asp ScriptManager control on the page to avoid the exception. Since each control of our ASP.NET AJAX suite is built on top of the ASP.NET AJAX framework, it is a prerequisite to have ScriptManager control add to the page which hosts the corresponding RadControl.

Further information about how to use RadControls in MOSS you can gather from the 'Integrating RadControls in MOSS' chapter in the documentation:

http://www.telerik.com/help/aspnet-ajax/introduction.html

Best regards,
Stephen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Sharepoint Integration
Asked by
atul
Top achievements
Rank 1
Answers by
Sebastian
Telerik team
Share this question
or