Refresh notification on taskmanager timed event.

  1. #1

    Refresh notification on taskmanager timed event.

    Hi Guys, just wondering if this is possible.
    I want to perminantly show a notification in the bottom right corner and refresh its content with the taskmanger without having to popup another notification.
    Possible?

    Cheers
  2. #2
    Hi,

    Welcome to Ext.NET!

    Here is the example.

    Example
    <%@ Page Language="C#" %>
     
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest)
            {
                Notification.Show(new NotificationConfig()
                    {
                        ID = "Notification1",
                        Html = "Hello world!<br/>" + DateTime.Now.Second,
                        AutoHide = false
                    });
            }
        }
    
        protected void Update(object sender, DirectEventArgs e)
        {
            string id = "Notification1",
                   newContent = "Hello world!<br/>" + DateTime.Now.Second,
                   script = string.Format("{0}.body.update('{1}');", id, newContent);
    
            X.AddScript(script);
        }
    </script>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Ext.NET Example</title>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            <ext:TaskManager runat="server" AutoRunDelay="5000" >
                <Tasks>
                    <ext:Task Interval="5000">
                        <DirectEvents>
                            <Update OnEvent="Update" />
                        </DirectEvents>
                    </ext:Task>
                </Tasks>
            </ext:TaskManager>
        </form>
    </body>
    </html>
  3. #3
    Awsome stuff thanks for the code :)

    Quote Originally Posted by Daniil View Post
    Hi,

    Welcome to Ext.NET!

    Here is the example.

    Example
    <%@ Page Language="C#" %>
     
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest)
            {
                Notification.Show(new NotificationConfig()
                    {
                        ID = "Notification1",
                        Html = "Hello world!<br/>" + DateTime.Now.Second,
                        AutoHide = false
                    });
            }
        }
    
        protected void Update(object sender, DirectEventArgs e)
        {
            string id = "Notification1",
                   newContent = "Hello world!<br/>" + DateTime.Now.Second,
                   script = string.Format("{0}.body.update('{1}');", id, newContent);
    
            X.AddScript(script);
        }
    </script>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Ext.NET Example</title>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            <ext:TaskManager runat="server" AutoRunDelay="5000" >
                <Tasks>
                    <ext:Task Interval="5000">
                        <DirectEvents>
                            <Update OnEvent="Update" />
                        </DirectEvents>
                    </ext:Task>
                </Tasks>
            </ext:TaskManager>
        </form>
    </body>
    </html>

Similar Threads

  1. [CLOSED] Taskmanager - change refresh time in code behind
    By tanky65 in forum 2.x Legacy Premium Help
    Replies: 6
    Last Post: Jan 13, 2013, 1:37 PM
  2. Replies: 0
    Last Post: Oct 05, 2011, 9:48 AM
  3. Refresh GridPanel data on postback event
    By huzzy143 in forum 1.x Help
    Replies: 6
    Last Post: Sep 05, 2011, 7:55 PM
  4. [CLOSED] Exporting Data using Refresh event
    By ecerrillos in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Sep 22, 2010, 3:32 PM
  5. Trigger store refresh event
    By dan182 in forum 1.x Help
    Replies: 4
    Last Post: Jun 23, 2010, 2:09 PM

Tags for this Thread

Posting Permissions