Action


Events:clear log container


Info
   1:  <%@ Page Title="AtomicProgressbar -- ServerSideEvents" Language="C#" AutoEventWireup="true" CodeBehind="ServerSideEvents.aspx.cs"
   2:      Inherits="Atom.Website.Samples.AtomicProgressbar.ServerSideEvents" %>
   3:   
   4:  <%@ Register Src="../Source.ascx" TagName="Source" TagPrefix="sample" %>
   5:  <%@ Register Assembly="Atom.Web" Namespace="Atom.Web.UI.WebControls" TagPrefix="atom" %>
   6:  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
   7:  <html xmlns="http://www.w3.org/1999/xhtml">
   8:  <head id="Header1" runat="server">
   9:      <link rel="Shortcut Icon" type="image/ico" href="../images/icon.png" />
  10:      <!-- The jQuery UI theme that will be used by the components. -->
  11:      <link href="../themes/base/jquery-ui.css" rel="stylesheet" type="text/css" />
  12:      <!-- jQuery runtime minified -->
  13:      <script src="../Scripts/jquery-1.9.1.js" type="text/javascript"></script>
  14:      <!-- jQuery UI runtime minified, client-side javascript of the components.-->
  15:      <script src="../Scripts/jquery-ui-1.10.3.custom.min.js" type="text/javascript"></script>
  16:      <!-- This style reference is needed only for the current example. -->
  17:      <link href="../css/example.css" rel="stylesheet" type="text/css" />
  18:   
  19:      <script type="text/javascript">
  20:          $(document).ready(function () {
  21:              $('#increase').button().click(function () {
  22:                  var currnetValue = <%= AtomicProgressbar1.ClientID %>.progressbar("value");
  23:                  <%= AtomicProgressbar1.ClientID %>.progressbar("value", currnetValue + 1);
  24:              });
  25:   
  26:              $('#decrease').button().click(function () {
  27:                  var currnetValue = <%= AtomicProgressbar1.ClientID %>.progressbar("value");
  28:                  <%= AtomicProgressbar1.ClientID %>.progressbar("value", currnetValue - 1);
  29:              });
  30:          });
  31:   
  32:          function ClearLogContainer() {
  33:              $("#<%= LogContainer.ClientID %>").val('');
  34:          }
  35:   
  36:      </script>
  37:  </head>
  38:  <body>
  39:      <form id="form1" runat="server">
  40:          <fieldset>
  41:              <legend>Action</legend>
  42:              <input id="increase" type="button" value="Increase" />
  43:              <input id="decrease" type="button" value="Decrease" />
  44:          </fieldset>
  45:          <br />
  46:          <div>
  47:              <atom:AtomicProgressbar ID="AtomicProgressbar1" runat="server" Value="99" OnValueChanged="AtomicProgressbar1_ValueChanged"
  48:                  OnCompleted="AtomicProgressbar1_Completed">
  49:              </atom:AtomicProgressbar>
  50:          </div>
  51:          <br />
  52:          <fieldset>
  53:              <legend>Events:</legend><a href="javascript:void(0);" style="float: right;" onclick="ClearLogContainer()">clear log container</a>
  54:              <asp:TextBox ID="LogContainer" runat="server" TextMode="MultiLine" Width="100%" Text=""
  55:                  Height="150px"></asp:TextBox>
  56:          </fieldset>
  57:          <br />
  58:          <sample:Source ID="Code" runat="server" />
  59:      </form>
  60:  </body>
  61:  </html>
   1:  using System;
   2:  using System.Collections.Generic;
   3:  using System.Linq;
   4:  using System.Web;
   5:  using System.Web.UI;
   6:  using System.Web.UI.WebControls;
   7:  using Atom.Web.UI.WebControls;
   8:   
   9:  namespace Atom.Website.Samples.AtomicProgressbar
  10:  {
  11:      public partial class ServerSideEvents : System.Web.UI.Page
  12:      {
  13:          protected void Page_Load(object sender, EventArgs e)
  14:          {
  15:   
  16:          }
  17:   
  18:          protected void AtomicProgressbar1_ValueChanged(object sender,  ProgressbarValueChangedEventArgs e)
  19:          {
  20:              LogContainer.Text += string.Format("ValueChanged at {0}\n", DateTime.Now.ToString("HH:mm:ss"));
  21:          }
  22:   
  23:          protected void AtomicProgressbar1_Completed(object sender,  ProgressbarCompletedEventArgs e)
  24:          {
  25:              LogContainer.Text += string.Format("Completed at {0}\n", DateTime.Now.ToString("HH:mm:ss"));
  26:          }
  27:      }
  28:  }
   1:  Imports System
   2:  Imports System.Collections.Generic
   3:  Imports System.Linq
   4:  Imports System.Web
   5:  Imports System.Web.UI
   6:  Imports System.Web.UI.WebControls
   7:  Imports Atom.Web.UI.WebControls
   8:  Namespace Atom.Website.Samples.AtomicProgressbar
   9:      Public Partial Class ServerSideEvents
  10:          Inherits System.Web.UI.Page
  11:          Protected Sub Page_Load(sender As Object, e As EventArgs)
  12:          End Sub
  13:          Protected Sub AtomicProgressbar1_ValueChanged(sender As Object, e As ProgressbarValueChangedEventArgs)
  14:              LogContainer.Text += String.Format("ValueChanged at {0}" & vbLf, DateTime.Now.ToString("HH:mm:ss"))
  15:          End Sub
  16:          Protected Sub AtomicProgressbar1_Completed(sender As Object, e As ProgressbarCompletedEventArgs)
  17:              LogContainer.Text += String.Format("Completed at {0}" & vbLf, DateTime.Now.ToString("HH:mm:ss"))
  18:          End Sub
  19:      End Class
  20:  End Namespace