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

Sharepoint: An unexpected error has occurred.

1 Answer 84 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Matthew asked on 03 Dec 2008, 10:43 PM

I downloaded the ASP.NET AJAX trial and I'm trying to use the grid control. I set up my web.config for AJAX 3.5, added the Telerik.Web.UI to the GAC, and added the necessary <SafeControls> to the web.config.

I'm trying to make a Sharepoint web part that just displays the grid. I'm following along in the help file but I've run into a problem. When I make any referece to a Telerik object Sharepoint display the very helpful error page. 

"An unexpected error has occurred."

I've sifted though all the log files that I can possibly locate and have found absolutely nothing to go on. 

Here is the code that I'm using for the OnInit. This right out of the help file. 

Protected Overloads Overrides Sub OnInit(ByVal e As EventArgs)
            Page.ClientScript.RegisterStartupScript(GetType(DealerPortal), Me.ID, "_spOriginalFormAction = document.forms[0].action;_spSuppressFormOnSubmitWrapper=true;", True)
            If Me.Page.Form IsNot Nothing Then
                Dim formOnSubmitAtt As String = Me.Page.Form.Attributes("onsubmit")
                If Not String.IsNullOrEmpty(formOnSubmitAtt) AndAlso formOnSubmitAtt = "return _spFormOnSubmitWrapper();" Then
                    Me.Page.Form.Attributes("onsubmit") = "_spFormOnSubmitWrapper();"
                End If
            End If
            Dim scriptManager As ScriptManager = scriptManager.GetCurrent(Me.Page)
            If scriptManager Is Nothing Then
                scriptManager = New RadScriptManager()
                Me.Page.Form.Controls.AddAt(0, scriptManager)
            End If
If I comment out the "RadScriptManager()" call then the web part will show up just fine. Otherwise I get the dreaded Sharepoint error page. 

I haven't even got to exposing the RadGird yet. It's gotten that bad. 

I've added the necessary reference and Imports statement to the class object. 

Does ANYONE have ANY ideas? 



One other question:

Do I have to use the AJAX version? Can I just use the ASP.NET version? AJAX sounds exciting and all, but this is horrible. 

Thanks again.

1 Answer, 1 is accepted

Sort by
Telerik team
answered on 08 Dec 2008, 12:04 PM
Hello Matthew,

I'm afraid that I'm not sure what may caused this error from the given details. Can you please post your full webpart declaration? Please make sure you have added correct reference to RadControls assembly to your webpart project.

Sincerely yours,
the Telerik team

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