Action


Events
clear log container


Info
   1:  <%@ Page Title="AtomicSlider -- Client side events" Language="C#" AutoEventWireup="true" CodeBehind="ClientSideEvents.aspx.cs"
   2:      Inherits="Atom.Website.Samples.AtomicSlider.ClientSideEvents" %>
   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:          function ClearLogContainer() {
  21:              $("#<%= LogContainer.ClientID %>").val('');
  22:          }
  23:          function OnSliderStart(event, ui) {
  24:   
  25:              $("#<%= LogContainer.ClientID %>").val($("#<%= LogContainer.ClientID %>").val() + '\nOnSliderStart at ' + Date() + ' value = ' + ui.value);
  26:          }
  27:          function OnValueChanged(event, ui) {
  28:   
  29:              $("#<%= LogContainer.ClientID %>").val($("#<%= LogContainer.ClientID %>").val() + '\nOnValueChanged at ' + Date() + ' value = ' + ui.value);
  30:          }
  31:          function OnValueChanging(event, ui) {
  32:   
  33:              $("#<%= LogContainer.ClientID %>").val($("#<%= LogContainer.ClientID %>").val() + '\nOnValueChanging at ' + Date() + ' value = ' + ui.value);
  34:          }
  35:      </script>
  36:  </head>
  37:  <body>
  38:      <form id="form1" runat="server">
  39:      <div>
  40:          <fieldset>
  41:              <legend>Action </legend>
  42:              <asp:CheckBox Text="Allow Range" runat="server" ID="IsRange" Checked="false" AutoPostBack="true"
  43:                  OnCheckedChanged="IsRange_CheckedChanged" />
  44:          </fieldset>
  45:          <br />
  46:          <div>
  47:              <atom:AtomicSlider ID="AtomicSlider1" runat="server">
  48:                  <ClientSideEvents OnSliderStart="OnSliderStart" OnValueChanged="OnValueChanged" OnValueChanging="OnValueChanging" />
  49:              </atom:AtomicSlider>
  50:          </div>
  51:          <br />
  52:          <fieldset>
  53:              <legend>Events</legend>
  54:              <div>
  55:                  <a href="javascript:void(0);" style="float: right;" onclick="ClearLogContainer()">clear
  56:                      log container</a>
  57:                  <asp:TextBox ID="LogContainer" runat="server" TextMode="MultiLine" Width="100%" Text=""
  58:                      Height="150px"></asp:TextBox>
  59:              </div>
  60:          </fieldset>
  61:          <br />
  62:          <sample:Source ID="Code" runat="server" />
  63:      </div>
  64:      </form>
  65:  </body>
  66:  </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.Slider;
   8:   
   9:  namespace Atom.Website.Samples.AtomicSlider
  10:  {
  11:      public partial class ClientSideEvents : System.Web.UI.Page
  12:      {
  13:          protected void Page_Load(object sender, EventArgs e)
  14:          {
  15:   
  16:          }
  17:   
  18:          protected void IsRange_CheckedChanged(object sender, EventArgs e)
  19:          {
  20:              AtomicSlider1.Range = (SliderRange)Enum.Parse(typeof(SliderRange), IsRange.Checked.ToString(), true);
  21:          }
  22:      }
  23:  }
   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.Slider
   8:  Namespace Atom.Website.Samples.AtomicSlider
   9:      Public Partial Class ClientSideEvents
  10:          Inherits System.Web.UI.Page
  11:          Protected Sub Page_Load(sender As Object, e As EventArgs)
  12:          End Sub
  13:          Protected Sub IsRange_CheckedChanged(sender As Object, e As EventArgs)
  14:              AtomicSlider1.Range = DirectCast([Enum].Parse(GetType(SliderRange), IsRange.Checked.ToString(), True), SliderRange)
  15:          End Sub
  16:      End Class
  17:  End Namespace