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

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Customizing AJAX Progress in DNNCustomizing AJAX Progress in DNN
Previous
 
Next
New Post
2/5/2008 9:15 PM
 

When I specified that my module/control supports partial rendering, DNN will automatically wrap it up with UpdatePanel, right? Of course, it comes with its progress indicator (defaulted to progress.gif in DNN's source).

My question is: Is it possible to modify the look and behaviour of this indicator? For example, there are some cases where I would like to display modal popup progress indicator that blocks the entire screen during postback. And how to do this exactly?

Thanks

 
New Post
2/7/2008 3:10 AM
 

If you look into AJAX.vb in the source code, then you will find that the progress.gif image is hardcoded :

        Public Shared Function WrapUpdatePanelControl(ByVal objControl As Control, ByVal blnIncludeProgress As Boolean) As Control

            ... remove for brevity ...

            If blnIncludeProgress Then
                'create image for update progress control
                Dim objImage As System.Web.UI.WebControls.Image = New System.Web.UI.WebControls.Image()
                objImage.ImageUrl = "~/images/progressbar.gif"  'hardcoded
                objContentTemplateContainer.Controls.Add(AJAX.CreateUpdateProgressControl(objPanel.ID, objImage))
            End If

            Return objPanel
        End Function

But there always a solution to "hack". Some of them are :

  • Modify WrapUpdatePanelControl to add CssClass attribute to objImage. The CssClass value should taken from configuration or similar like that, so it's value will be dynamically loaded. Recompile the DNN framework. :)
  • Using JavaScript to modify progress bar value at runtime.

If you right click on your DNN page and see it's HTML source then you will find that DNN framework will create this tag to create progress bar indicator :

<div id="dnn_ctr371_HelloWorld_UP_Prog" style="display:none;">
<img src="/dotnetnuke/images/progressbar.gif" style="border-width:0px;" />
</div>

371 is the ModuleID, HelloWorld is the ModuleName and the rest is static string. When using javascript, the idea is getting reference to that div element at runtime. So, this code will construct it's form based on your module (I hardcode the dnn_ctrl and _UP_Prog string):

    var progressbarid = "dnn_ctr<%= this.ModuleId.ToString()  %>_<%=this.ModuleConfiguration.ModuleName %>_UP_Prog";

First, create your Module (mine using C#) and add new user control (let say HelloWorld.ascx). Make sure you check the Support Partial Rendering when registering HelloWorld.ascx from Module Definitions. Write this code :

<style type="text/css">
.modalPopup {
 background-color:#ffffdd;
 border-width:3px;
 border-style:solid;
 border-color:Gray;
 padding:3px;
 width:250px;
}
</style>

<script language="javascript" type="text/javascript">
function ChangeLayout() {
    var progressbarid = "dnn_ctr<%= this.ModuleId.ToString()  %>_<%=this.ModuleConfiguration.ModuleName %>_UP_Prog";
    var gambar = document.getElementById(progressbarid);
    gambar.className="modalPopup";
}
</script>

<asp:Button ID="button1" Text="Show" runat="server" OnClick="button1_Click" />
<br />
<asp:Label ID="label1" runat="server"></asp:Label>

The logic is simple. I just add one button with one label. Then when the button clicked, i will simulate long running process using System.Threading.Thread.Sleep(2000) in order to show the progress indicator.

Open your code behind, and add this into your code :

    protected void Page_Load(object sender, EventArgs e) {
    }

    protected override void OnInit(EventArgs e) {
        button1.Attributes.Add("onfocus", "ChangeLayout();");
        base.OnInit(e);
    }

    protected void button1_Click(object sender, EventArgs e) {
        System.Threading.Thread.Sleep(2000); // Just simulate to long running process

        label1.Text += "test";
    }

Then save, and load your module. When you click the button1, you'll see that the progress bar indicator change it's style. :)

Well, it works on the first time when you click the button. Second click to the button will failed. :(

But i think you will got the idea. Or maybe someone has a good solution on it. Or maybe DNN Core Team will add a functionality to change the behavior of progress bar to be more dynamic and can be customized in the next release of DNN.

HTH.

CMIIW.

 
New Post
2/7/2008 9:53 PM
 

Is it possible to use AjaxControlToolkit? Maybe some ModalPopupExtender?

Anyone got any experience on this one?

 
New Post
2/11/2008 2:45 AM
 

AjaxControl Toolkit can be integrated well with DotNetNuke. But yes there is some issue regarding about positioning. But since the ACT source code is provided, then you can modify based on your need.

 
New Post
2/11/2008 6:10 AM
 

Hi Ferry. How r u?

i am using AjaxControlToolkit in my project and it works nice. i am using all control in usercontrol.

so just register your page with following code

AJAX.RegisterScriptManager(); -- and nothing else

and start drag and drop controltoolkit.

Bye


Sahil

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Customizing AJAX Progress in DNNCustomizing AJAX Progress in DNN


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