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

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

2 Answers 490 Views
ScriptManager and StyleSheetManager
This is a migrated thread and some comments may be shown as answers.
srikanth
Top achievements
Rank 1
srikanth asked on 30 Apr 2009, 04:12 PM
HI
1)I had master page "telerik_ex.master" which contains "ASP.Net Scriptmanager"  (I should maintain this Asp.net 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.


Thanks
Srikanth Gn

2 Answers, 1 is accepted

Sort by
0
Accepted
illumination
Top achievements
Rank 2
answered on 11 Jun 2009, 12:48 PM
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" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" > 
 
<html xmlns="http://www.w3.org/1999/xhtml" > 
<head runat="server">  
</head> 
<body style="text-align:center">  
    <form id="form1" runat="server">  
            <telerik:RadScriptManager ID="RadScriptManager1" runat="server">  
                <Scripts> 
                    <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.....
                </Scripts> 
            </telerik:RadScriptManager> 
             

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">  
            <AjaxSettings> 
                <telerik:AjaxSetting AjaxControlID="RadScheduler1">  
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="RadScheduler1" LoadingPanelID="RadAjaxLoadingPanel1" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
            </AjaxSettings> 
        </telerik:RadAjaxManager> 

That's my suggestions. Good luck!
0
nikesh
Top achievements
Rank 1
answered on 19 Aug 2010, 07:22 PM
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!!
Tags
ScriptManager and StyleSheetManager
Asked by
srikanth
Top achievements
Rank 1
Answers by
illumination
Top achievements
Rank 2
nikesh
Top achievements
Rank 1
Share this question
or