I wish to find out how to render ASP.NET's Script Manager followed by the UpdatePanel in an webpage on Ubuntu 16.04.
The following aspx script code runs fine on Windows 7 Microsoft Visual Studio 2013 combined with Xamarin Studio.
However, when I request the URL 127.0.0.1:9000/Tutorial.aspx in a Firefox web browser with apache2 and xsp4 running , I encounter the following exception.
System.InvalidOperationException The control with ID 'UpdatePanel1' requires a ScriptManager on the page. The ScriptManager must appear before any controls that need it.
Description: HTTP 500.Error processing request.
Details: Non-web exception. Exception origin (name of application or object): System.Web.Extensions.
Exception stack trace:
at System.Web.UI.UpdatePanel.get_ScriptManager () <0x41cfa1b0 + 0x0015f> in <filename unknown>:0
at System.Web.UI.UpdatePanel.RegisterPanel () <0x41cfa0b0 + 0x000a7> in <filename unknown>:0
at System.Web.UI.UpdatePanel.OnInit (System.EventArgs e) <0x41cfa050 + 0x0001f> in <filename unknown>:0
at System.Web.UI.Control.InitRecursive (System.Web.UI.Control namingContainer) <0x41cf9820 + 0x0013c> in <filename unknown>:0
at System.Web.UI.Control.InitRecursive (System.Web.UI.Control namingContainer) <0x41cf9820 + 0x000a4> in <filename unknown>:0
at System.Web.UI.Control.InitRecursive (System.Web.UI.Control namingContainer) <0x41cf9820 + 0x000a4> in <filename unknown>:0
at System.Web.UI.Page.InternalProcessRequest () <0x41cf82d0 + 0x003e1> in <filename unknown>:0
at System.Web.UI.Page.ProcessRequest (System.Web.HttpContext context) <0x41cea5e0 + 0x001f3> in <filename unknown>:0
<body>
<form id="form2" runat="server">
<div>
<div class="container">
<div>
<div class="imageFormHead">
<asp:Label runat="server" Text="<%$ Resources:Resource, FT_formTitle %>"></asp:Label>
<cc1:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></cc1:ToolkitScriptManager>
</div>
<div>
<asp:ScriptManager ID="ScriptManagerBC" runat="server" />
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<cc1:TabContainer id="TabControl" runat="server" activetabindex="0" AutoPostBack="True" OnActiveTabChanged="TabControl_ActiveTabChanged">
</cc1:TabContainer>
</ContentTemplate>
</asp:UpdatePanel>
Please suggest a solution which enables me to avoid the above exception.
I used this URL: https://stackoverflow.com/questions/7525525/how-to-add-an-updatepanel-controls-to-a-page-programmatically and I failed to add an update panel control to my test web page programmatically.
System.NullReferenceException
Object reference not set to an instance of an object
Description: HTTP 500.Error processing request.
Details: Non-web exception. Exception origin (name of application or object): System.Web.Extensions.
Exception stack trace:
at System.Web.Handlers.ScriptResourceHandler.EncryptString (System.String s) <0x418eada0 + 0x00150> in <filename unknown>:0
at System.Web.Handlers.ScriptResourceHandler+RuntimeScriptResourceHandler.System.Web.Handlers.IScriptResourceHandler.GetScriptResourceUrl (System.Reflection.Assembly assembly, System.String resourceName, System.Globalization.CultureInfo culture, Boolean zip, Boolean notifyScriptLoaded) <0x418e70a0 + 0x00617> in <filename unknown>:0
at System.Web.Handlers.ScriptResourceHandler.GetScriptResourceUrl (System.Reflection.Assembly assembly, System.String resourceName, System.Globalization.CultureInfo culture, Boolean zip, Boolean notifyScriptLoaded) <0x418e6f40 + 0x00055> in <filename unknown>:0
at System.Web.UI.ScriptReference.GetUrlFromName (System.Web.UI.ScriptManager scriptManager, IControl scriptManagerControl, Boolean zip) <0x418e58e0 + 0x000ff> in <filename unknown>:0
at System.Web.UI.ScriptReference.GetUrl (System.Web.UI.ScriptManager scriptManager, IControl scriptManagerControl, Boolean zip) <0x418e5680 + 0x0012b> in <filename unknown>:0
at System.Web.UI.ScriptManager.RegisterScripts () <0x418e30f0 + 0x0031b> in <filename unknown>:0
at System.Web.UI.ScriptManager.OnPagePreRenderComplete (System.Object sender, System.EventArgs e) <0x418e2f00 + 0x000ef> in <filename unknown>:0
at System.Web.UI.Page.OnPreRenderComplete (System.EventArgs e) <0x418e2a80 + 0x00090> in <filename unknown>:0
at System.Web.UI.Page.ProcessLoadComplete () <0x418c3ce0 + 0x001e0> in <filename unknown>:0
at System.Web.UI.Page.InternalProcessRequest () <0x41876930 + 0x0049f> in <filename unknown>:0
[EDIT June 29 2016 7:06P.M] I discovered this evening that a major cause of my problem is that I was mixing apples and oranges. The "apples" being Microsoft's asp:ScriptManager and the "oranges" being Mono's asp:ScriptManager. Does any expert know why I get this error and how to fix it?
Any help is greatly appreciated.