Jun 12, 2010, 8:38 PM
Problem With ScriptManager on MasterPage
Hi,
I have a question about usage of coolite controls on asp MasterPage.
I want to use toolbar as my menu, so I place toolbar on masterpage. To make it work, I added ScriptManager, also on MasterPage. Because I can only use one ScriptManager, I had to remove all other SM from content pages. And here is a trouble..
When I use a ext:Button or ext:ToolbarButton, or any other control with AjaxEvent, I get a following error:
Server Error in '/' Application.
--------------------------------------------------------------------------------
The control with ID 'm_menuStart' not found
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: The control with ID 'm_menuStart' not found
Source Error:
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.
Stack Trace:
[HttpException (0x80004005): The control with ID 'm_menuStart' not found]
Coolite.Ext.Web.ScriptManager.RaisePostBackEvent(S tring eventArgument) +1102
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +176
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5563
Code of MasterPage:
This error is not present, when I use a different ScriptManager for each content page. But this is not a solution, because I had to remove SM from MasterPage, hence I cannot use toolbar as a menu.
Can anybody provide a solution?
I have a question about usage of coolite controls on asp MasterPage.
I want to use toolbar as my menu, so I place toolbar on masterpage. To make it work, I added ScriptManager, also on MasterPage. Because I can only use one ScriptManager, I had to remove all other SM from content pages. And here is a trouble..
When I use a ext:Button or ext:ToolbarButton, or any other control with AjaxEvent, I get a following error:
Server Error in '/' Application.
--------------------------------------------------------------------------------
The control with ID 'm_menuStart' not found
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: The control with ID 'm_menuStart' not found
Source Error:
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.
Stack Trace:
[HttpException (0x80004005): The control with ID 'm_menuStart' not found]
Coolite.Ext.Web.ScriptManager.RaisePostBackEvent(S tring eventArgument) +1102
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +176
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5563
Code of MasterPage:
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site.master.cs" Inherits="BadzAktywny.SiteMaster" %>
<%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head runat="server">
<title></title>
<link href="~/Styles/Site.css" rel="stylesheet" type="text/css" />
<asp:ContentPlaceHolder ID="HeadContent" runat="server"></asp:ContentPlaceHolder>
</head>
<body>
<form runat="server">
<ext:ScriptManager ID="smTemplate" runat="server">
</ext:ScriptManager>
<div class="page">
<div class="header">
<div class="title">
......
<ext:Toolbar ID="Toolbar1" runat="server">
<Items>
<ext:ToolbarButton ID="m_menuStart" runat="server" Text="Start">
<AjaxEvents>
<Click OnEvent="m_menuAbout_Click">
<EventMask ShowMask="true" />
<ExtraParams>
<ext:Parameter Name="Param" Value="Menu 3" Mode="Value" />
</ExtraParams>
</Click>
</AjaxEvents>
</ext:ToolbarButton>
</Items>
</ext:Toolbar>
and in codebehind:
protected void m_menuAbout_Click(object sender, AjaxEventArgs e)
{
Response.Redirect("~/Pages/Account/Login.aspx");
}
This error is not present, when I use a different ScriptManager for each content page. But this is not a solution, because I had to remove SM from MasterPage, hence I cannot use toolbar as a menu.
Can anybody provide a solution?