how to handle scriptmanager (which is in masterpage) & radscriptmnager (which is in Content page)

3 posts, 1 answers
  1. srikanth
    srikanth avatar
    12 posts
    Member since:
    Apr 2009

    Posted 30 Apr 2009 Link to this post

    1)I had master page "telerik_ex.master" which contains "ASP.Net Scriptmanager"  (I should maintain this scriptmanager in this master page )

    2) I want to use  radscriptmanager in "content" page 

    3) But it gives the error page can't have two scriptmanager but how I can use ?

    I am getting following error message
    message:    Only one instance of a ScriptManager can be added to the page.

    Srikanth Gn
  2. Answer
    illumination avatar
    85 posts
    Member since:
    May 2008

    Posted 11 Jun 2009 Link to this post

    I came across this problem a while back. The radscriptmanager must be use only once in Master page or the scriptmanager that must be use only once in each of content pages. My suggestion is creating all the script in the master page with radscriptmanager since it is easier to manage and you don't have to keep inserting scriptmanager on each of content pages.

    For master page:
    <%@ Master Language="VB" CodeFile="Sim.master.vb" Inherits="_master" %> 
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "" > 
    <html xmlns="" > 
    <head runat="server">  
    <body style="text-align:center">  
        <form id="form1" runat="server">  
                <telerik:RadScriptManager ID="RadScriptManager1" runat="server">  
                        <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" /> 
                        <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" /> 
                        PUT YOUR SCRIPT HERE.....

    If you decide to use scriptmanager in each contentpage which I don't recommend, this is the example:
    (Master must have no radscriptmanager or scriptmanager)
    <%@ Page Language="vb" AutoEventWireup="false" MasterPageFile="~/Master1.Master"   
        CodeBehind="CreateNew.aspx.vb" Inherits="Sim.CreateNew"   
        title="Create New" %> 
    <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %> 
    <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">  
            <asp:ScriptManager ID="ScriptManager" runat="server" /> 
            <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">  
                    <telerik:AjaxSetting AjaxControlID="RadScheduler1">  
                            <telerik:AjaxUpdatedControl ControlID="RadScheduler1" LoadingPanelID="RadAjaxLoadingPanel1" /> 

    That's my suggestions. Good luck!
  3. nikesh
    nikesh avatar
    1 posts
    Member since:
    Aug 2010

    Posted 19 Aug 2010 Link to this post

    hi!! sir this is nikesh,
    i m creating master page ....when i run my page show some error..............

    Only one instance of a ScriptManager can be added to the page.

    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.
    how to solve my problem plz suggest me!!
    i'm aataching my "masterpage.master" file
    plz help me!!
Back to Top