Design Page (MasterPage.master):
here, I use a ScriptManager, Panel (black colored) and a button. And also use Ajax ModalPopupExtender1.
Source Code (MasterPage):
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>
<%@ Register Assembly ="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="pm" %>
Code View(MasterPage):
public partial class MasterPage : System.Web.UI.MasterPage
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
ModalPopupExtender1.Show();
}
}
Design Part (Default3.aspx)
here I use a UpdatePanel. Does not use any extra ScriptManager.
Source View (Default3.aspx)
<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Default3.aspx.cs" Inherits="Default3" Title="Untitled Page" %>
Code View (Default3.aspx.cs)
public partial class Default3 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button9_Click(object sender, EventArgs e)
{
Label1.Text = "Hello";
}
}
Run (Show Error)
Then I add a ScriptManager on Default3.aspx page.
Design Part (Default3.aspx): Modified:
Then Again Run Default3.aspx:
Error:
This is the Problem...................
Please solve this problem whereas I use multiple ScriptManager in another page using MasterPage (where already use ScriptManager).
Khan Abrar AhmedPosted May 22, 2014, 5:31 AM
Below is what MSDN says about ScriptManager Control.
Only one instance of the ScriptManager control can be added to the page. The page can include the control directly, or indirectly inside a nested component such as a user control, content page for a master page, or nested master page. If a page already contains a ScriptManager control, but a nested or parent component needs additional features of the ScriptManager control, the component can include a ScriptManagerProxy control. For example, the ScriptManagerProxy control enables you to add scripts and services that are specific to nested components
http://msdn.microsoft.com/en-us/library/system.web.ui.scriptmanager.aspx
http://msdn.microsoft.com/en-us/library/vstudio/bb398867%28v=vs.100%29.aspx