Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsClientAPIClientAPIproblem with ScriptManagerproblem with ScriptManager
Previous
 
Next
New Post
8/31/2007 12:22 AM
 

Hi,

I am trying to run a simple module with ScriptManager and I can run my sample with one control but as soon as I add another instance to the same page I am getting an error message :

Again code is working fine if I have only one instance; but when I add a second I am getting this:

Unhandled error loading module.
DotNetNuke.Services.Exceptions.ModuleLoadException: Unhandled Error Adding Module to Pane6 ---> System.InvalidOperationException: Only one instance of a ScriptManager can be added to the page. at System.Web.UI.ScriptManager.OnInit(EventArgs e) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.AddedControl(Control control, Int32 index) at System.Web.UI.ControlCollection.Add(Control child) at DotNetNuke.UI.Skins.Skin.InjectModule(Control objPane, ModuleInfo objModule, PortalSettings PortalSettings) --- End of inner exception stack trace ---

my page / code below :

protected

void Button1_Click(object sender, EventArgs e)"New Time : " + System.DateTime.Now.ToString();

<%

<%

@ Control language="C#" Inherits="YourCompany.Modules.MySampleModule2.ViewMySampleModule2" CodeFile="ViewMySampleModule2.ascx.cs" AutoEventWireup="true"%>@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"

 

<%

Namespace="System.Web.UI" TagPrefix="asp" %>@ Register TagPrefix="dnn" TagName="Audit" Src="~/controls/ModuleAuditControl.ascx" %>

<

<

</

<

asp:Panel ID="Panel1" runat="server" Height="50px" Width="125px" BorderStyle="Solid" BorderColor="1">asp:ScriptManager ID="ScriptManager1" runat="server">asp:ScriptManager>asp:UpdatePanel ID="UpdatePanel1" runat="server">

 

<ContentTemplate>

 

<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>

 

<br >

 

<asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" />

 

</

<

</

</

</ContentTemplate>asp:UpdatePanel>asp:Timer ID="Timer1" runat="server">asp:Timer>asp:Panel>

 

{

Label1.Text =

}

 
New Post
8/31/2007 3:41 PM
 

You should check if the manager is already registered on the page, if so, don't register it again.

AFAIK


Chris Hammond
Former DNN Corp Employee, MVP, Core Team Member, Trustee
Christoc.com Software Solutions DotNetNuke Module Development, Upgrades and consulting.
dnnCHAT.com a chat room for DotNetNuke discussions
 
New Post
8/31/2007 3:50 PM
 

I am not using register command/code ; I dropped ScriptManager contol in my control;  that is why I posted complete page source

in any case I was able to fix it; but i am not sure if this 'Kosher' solution

I dropped ScriptManager control on the default.aspx page and I used ScriptManagerProxy control to point to the default page.

is this kosher?????

again I am trying to use ScriptManager control and UpdatePanel control in my module for AJAX postback; if you have a sample that doesn't requer Microsoft AJAX ScriptManager control to refresh/post back UpdatePanel; please post it.

 

 

 
New Post
9/4/2007 1:17 PM
 

Changing the core code is not recommended as it makes your upgrade process much more difficult.  The DNN Framework already provides a method to register the script manager for you. 

DotNetNuke.Framework.AJAX.RegisterScriptManager()


 
New Post
9/4/2007 10:50 PM
 

thank you very much; it's working but now I have another problem:

my c# code looks like this, and if you want I can post my html /asp source.

        protected void Timer1_Tick(object sender, EventArgs e)
        {
            RetriveData();
        }

        private void RetriveData()
        {
            WSMonitor.BAL.DataWrapper wrapper = new WSMonitor.BAL.DataWrapper((PortalModuleBase)this);
            string sql = "SELECT top 10 table_name, column_name FROM information_schema.columns order by newid()";
            DataSet data = wrapper.SelectCurrentPortal(sql);
                GridView2.DataSource = data;
                GridView2.DataBind();
        }
        protected void Page_Load(System.Object sender, System.EventArgs e)
        {
            if (DotNetNuke.Framework.AJAX.IsInstalled())
            {
                DotNetNuke.Framework.AJAX.RegisterScriptManager();
               
            }
            if (!Page.IsPostBack)
            {
                RetriveData();
            }
}

if I have only one module on the page, this code is running fine and I am getting data back every 2 seconds, as soon as I add the same module to another pane or another instance to the same pane, the code is stop working for one module but it still works for another; in the nutshell it works only if I have only one module; looks like that script manager can update only one module; is it possible to force the script manager to manage / update multple controls? in my case I need to have 4 modules on the page and every module/control should be able to use ajax to refresh it self with different refresh interval.

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsClientAPIClientAPIproblem with ScriptManagerproblem with ScriptManager


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out