Hi,
I've been encountering a problem when I use RadScriptManager. In the master page, I registered the Telerik.Web.UI and added the RadScriptManager.
<%@ Register Assembly="Telerik.Web.UI, Version=2008.1.619.20, Culture=neutral, PublicKeyToken=121fae78165ba3d4" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> |
<telerik:RadScriptManager ID="ScriptManager1" runat="server" EnableTheming="True"/> |
But when I try to use this master page, I get an error. The error says:
NullReferenceException: Object reference not set to an instance of an object.]
Telerik.Web.UI.WebResource.Exists(String path, String applicationPath) +257
Telerik.Web.UI.RadScriptManager.OnPreRender(EventArgs e) +80
System.Web.UI.Control.PreRenderRecursiveInternal() +77
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1360
I am not sure what the problem is or where to start looking. I tried removing the RadScriptManager and use <asp:ScriptManager> instead and the error is gone. Can somebody help me with this?
Thank you!
Regards,
Francis
9 Answers, 1 is accepted
You need to register the httpHandler of RadScriptManager inside the httphandler section of web.config. You should click on the smart tag of the RadScriptManager and select Register Telerik.Web.UI.WebResource.axd.
Best regards,
Daniel
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
Thank you for the reply. I did register the RadScriptManager in the httphandler but I registered the wrong version. I didn't get the error anymore although the I am getting a weird behavior of the control.
The control is not displaying in my page although when I try a View Source of my page, I can see that the control was rendered in the page. But they have a "none" value in the display property. We didn't set anything in the code but I keep on getting this value even when I try to add 'style="display:none;" in the control.
<span
id="ctl00_PlaceHolderTitleBreadcrumb_RadAjaxManager1" style="display:none;"></span>
<div id="ctl00_PlaceHolderTitleBreadcrumb_RadAjaxLoadingPanel1" style="display:none;height:24px;width:75px;"
This is my code in my aspx page.
<script runat="server"> | |
Const RoleAndExpertise As String = "Role and Expertise" | |
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load | |
If Not Page.IsPostBack Then | |
addTab("Role and Expertise") | |
addPageView(RadTabStrip1.FindTabByText(RoleAndExpertise)) | |
addTab("Contact") | |
addTab("Collaboration") | |
addTab("Blog") | |
addTab("Personal") | |
End If | |
End Sub | |
Protected Sub RadMultiPage1_PageViewCreated(ByVal sender As Object, ByVal e As RadMultiPageEventArgs) Handles RadMultiPage1.PageViewCreated | |
Dim userControlName As String = Me.getControlName(e.PageView.ID) | |
Dim userControl As Control = Page.LoadControl(userControlName) | |
userControl.ID = e.PageView.ID & "_userControl" | |
e.PageView.Controls.Add(userControl) | |
End Sub | |
Protected Sub RadTabStrip1_TabClick(ByVal sender As Object, ByVal e As RadTabStripEventArgs) Handles RadTabStrip1.TabClick | |
addPageView(e.Tab) | |
e.Tab.PageView.Selected = True | |
End Sub | |
Private Sub addTab(ByVal tabName As String) | |
Dim tab As RadTab = New RadTab | |
tab.Text = tabName | |
RadTabStrip1.Tabs.Add(tab) | |
End Sub | |
Private Function getControlName(ByVal pageViewID As String) As String | |
Dim retVal As String = pageViewID | |
Select Case (pageViewID) | |
Case RoleAndExpertise | |
retVal = "RoleAndExpertise" | |
End Select | |
Return "~/_controltemplates/" + retVal + "Tab.ascx" | |
End Function | |
Private Sub addPageView(ByVal tab As RadTab) | |
Dim pageView As RadPageView = New RadPageView | |
pageView.ID = tab.Text | |
RadMultiPage1.PageViews.Add(pageView) | |
'pageView.CssClass = "pageView" | |
tab.PageViewID = pageView.ID | |
End Sub | |
</script> | |
<asp:Content contentplaceholderid="PlaceHolderTitleBreadcrumb" runat="server"> | |
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" style="display:block"> | |
<AjaxSettings> | |
<telerik:AjaxSetting AjaxControlID="RadTabStrip1"> | |
<UpdatedControls> | |
<telerik:AjaxUpdatedControl ControlID="RadTabStrip1" /> | |
<telerik:AjaxUpdatedControl ControlID="RadMultiPage1" LoadingPanelID="RadAjaxLoadingPanel1" /> | |
</UpdatedControls> | |
</telerik:AjaxSetting> | |
<telerik:AjaxSetting AjaxControlID="RadMultiPage1"> | |
<UpdatedControls> | |
<telerik:AjaxUpdatedControl ControlID="RadMultiPage1" /> | |
</UpdatedControls> | |
</telerik:AjaxSetting> | |
</AjaxSettings> | |
</telerik:RadAjaxManager> | |
<script type="text/javascript"> | |
function onTabSelecting(sender, args) | |
{ | |
if (args.get_tab().get_pageViewID()) | |
{ | |
args.get_tab().set_postBack(false); | |
} | |
} | |
</script> | |
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Height="24px" Width="75px"> | |
<img alt="Loading..." src="images/loading7.gif" /></telerik:RadAjaxLoadingPanel><div> | |
</div> | |
<telerik:RadTabStrip ID="RadTabStrip1" runat="server" OnClientTabSelecting="onTabSelecting" Skin="Hay" MultiPageID="RadMultiPage1" SelectedIndex="0"> | |
</telerik:RadTabStrip> | |
<telerik:RadMultiPage ID="RadMultiPage1" runat="server" Height="4px" SelectedIndex="0"> | |
</telerik:RadMultiPage> | |
</asp:Content> |
Please check if the attached project (build over your code) represents the desired behavior. I hope this helps!
Regards,
Daniel
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
There is a minor error in the documentation located at: http://www.telerik.com/help/aspnet-ajax/moss-deploying-radcontrols.html section 3: IIS6,etc.
Line:
<add path="Telerik.Web.UI.WebResource.axd"verb="*"type="Telerik.Web.UI.WebResource, Telerik.Web.UI" validate="false" />
you get:
Unhandled Exception caught: System.NullReferenceException: Object reference not set to an instance of an object. at Telerik.Web.UI.WebResource.Exists(HttpContext context, String path, String applicationPath) at Telerik.Web.UI.RadScriptManager.OnPreRender(EventArgs e) at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
The following line works outside of SharePoint in a separate web app, but gave me 401s in the IIS log for SharePoint web app and the controls did not work - RadTextBox did not retain postback values, radcombobox did not ropdown):
<add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" validate="false" />
For it to work in SharePoint, it should be: (avoid 401s in IIS Log)
<add path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource, Telerik.Web.UI, Version=2010.3.1317.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" validate="false" />
Thank you for your suggestion. As a sign of gratitude I updated your Telerik points.
Best regards,
Daniel
the Telerik team
My bad - sorry for that. Your points are updated now.
Best regards,
Daniel
the Telerik team
Hi Arthur,
Am having the same problems, how did you solve it?
Thanks
Please verify whether the http handler is registered correctly in the web.config file.
For more information, examine the following topic:
RadScriptManager
Kind regards,
Daniel
the Telerik team