Action


Events: clear log container


Info
   1:  <%@ Page Title="AtomicSlider -- Server Side Events" Language="C#" AutoEventWireup="true" CodeBehind="ServerSideEvents.aspx.cs"
   2:      Inherits="Atom.Website.Samples.AtomicSlider.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:      <script type="text/javascript">
  19:          function ClearLogContainer() {
  20:              $("#<%= LogContainer.ClientID %>").val('');
  21:          }
  22:      </script>
  23:  </head>
  24:  <body>
  25:      <form id="form1" runat="server">
  26:      <fieldset>
  27:          <legend>Action</legend>
  28:          <asp:CheckBox Text="Allow Range" runat="server" ID="IsRange" Checked="false" AutoPostBack="true"
  29:              OnCheckedChanged="IsRange_CheckedChanged" />
  30:      </fieldset>
  31:      <br />
  32:      <div>
  33:          <atom:AtomicSlider ID="AtomicSlider1" runat="server" OnSelectedValueChanged="AtomicSlider1_SelectedValueChanged"
  34:              OnSelectedValueChanging="AtomicSlider1_SelectedValueChanging">
  35:          </atom:AtomicSlider>
  36:      </div>
  37:      <br />
  38:      <fieldset>
  39:          <legend>Events:</legend><a href="javascript:void(0);" style="float: right;" onclick="ClearLogContainer()">
  40:              clear log container</a>
  41:          <asp:TextBox ID="LogContainer" runat="server" TextMode="MultiLine" Width="100%" Text=""
  42:              Height="150px"></asp:TextBox>
  43:      </fieldset>
  44:      <br />
  45:      <sample:Source ID="Code" runat="server" />
  46:      </form>
  47:  </body>
  48:  </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:  using Atom.Web.UI.WebControls.Slider;
   9:   
  10:  namespace Atom.Website.Samples.AtomicSlider
  11:  {
  12:      public partial class ServerSideEvents : System.Web.UI.Page
  13:      {
  14:          protected void Page_Load(object sender, EventArgs e)
  15:          {
  16:   
  17:          }
  18:   
  19:          protected void IsRange_CheckedChanged(object sender, EventArgs e)
  20:          {
  21:              AtomicSlider1.Range = (SliderRange)Enum.Parse(typeof(SliderRange), IsRange.Checked.ToString(), true);
  22:          }
  23:   
  24:          protected void AtomicSlider1_SelectedValueChanged(object sender, SliderValueChangedEventArgs e)
  25:          {
  26:              LogContainer.Text += string.Format("ValueChanged new value: {0} at {1}\n", e.NewValue, DateTime.Now.ToString("HH:mm:ss"));
  27:          }
  28:   
  29:          protected void AtomicSlider1_SelectedValueChanging(object sender,  SliderValueChangingEventArgs e)
  30:          {
  31:              LogContainer.Text += string.Format("ValueChanging old value: {0} at {1}\n", e.OldValue, DateTime.Now.ToString("HH:mm:ss"));
  32:          }
  33:      }
  34:  }
   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:  Imports Atom.Web.UI.WebControls.Slider
   9:  Namespace Atom.Website.Samples.AtomicSlider
  10:      Public Partial Class ServerSideEvents
  11:          Inherits System.Web.UI.Page
  12:          Protected Sub Page_Load(sender As Object, e As EventArgs)
  13:          End Sub
  14:          Protected Sub IsRange_CheckedChanged(sender As Object, e As EventArgs)
  15:              AtomicSlider1.Range = DirectCast([Enum].Parse(GetType(SliderRange), IsRange.Checked.ToString(), True), SliderRange)
  16:          End Sub
  17:          Protected Sub AtomicSlider1_SelectedValueChanged(sender As Object, e As SliderValueChangedEventArgs)
  18:              LogContainer.Text += String.Format("ValueChanged new value: {0} at {1}" & vbLf, e.NewValue, DateTime.Now.ToString("HH:mm:ss"))
  19:          End Sub
  20:          Protected Sub AtomicSlider1_SelectedValueChanging(sender As Object, e As SliderValueChangingEventArgs)
  21:              LogContainer.Text += String.Format("ValueChanging old value: {0} at {1}" & vbLf, e.OldValue, DateTime.Now.ToString("HH:mm:ss"))
  22:          End Sub
  23:      End Class
  24:  End Namespace