Action Step to increments:
 



Info
   1:  <%@ Page Title="AtomicSlider -- Snap To Increments" Language="C#" AutoEventWireup="true" CodeBehind="SnapToIncrements.aspx.cs"
   2:      Inherits="Atom.Website.Samples.AtomicSlider.SnapToIncrements" %>
   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:          $(document).ready(function () {
  20:              $('#<%=SetStep.ClientID %>').button();
  21:          });
  22:      </script>
  23:  </head>
  24:  <body>
  25:      <form id="form1" runat="server">
  26:          <div>
  27:              <fieldset>
  28:                  <legend>Action </legend>Step to increments:
  29:              <asp:TextBox runat="server" ID="StepToInc" />
  30:                  <asp:Button ID="SetStep" Text="Set" runat="server" OnClick="SetStep_Click" /><br />
  31:                  <asp:RegularExpressionValidator ID="Validation" runat="server" ControlToValidate="StepToInc"
  32:                      Style='color: red' ErrorMessage="Please Enter Only Numbers" ValidationExpression="^\d+$"></asp:RegularExpressionValidator>
  33:              </fieldset>
  34:              <br />
  35:              <atom:AtomicSlider ID="AtomicSlider1" runat="server" Step="5" Value="50">
  36:              </atom:AtomicSlider>
  37:          </div>
  38:          <br />
  39:          <sample:Source ID="Code" runat="server" />
  40:      </form>
  41:  </body>
  42:  </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:   
   8:  namespace Atom.Website.Samples.AtomicSlider
   9:  {
  10:      public partial class SnapToIncrements : System.Web.UI.Page
  11:      {
  12:          protected void Page_Load(object sender, EventArgs e)
  13:          {
  14:              if (!IsPostBack)
  15:              {
  16:                  StepToInc.Text = AtomicSlider1.Step.ToString();
  17:              }
  18:          }
  19:   
  20:          protected void SetStep_Click(object sender, EventArgs e)
  21:          {
  22:              if (Validation.IsValid)
  23:              {
  24:                  AtomicSlider1.Step = Convert.ToInt32(StepToInc.Text);
  25:              }
  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:  Namespace Atom.Website.Samples.AtomicSlider
   8:      Public Partial Class SnapToIncrements
   9:          Inherits System.Web.UI.Page
  10:          Protected Sub Page_Load(sender As Object, e As EventArgs)
  11:              If Not IsPostBack Then
  12:                  StepToInc.Text = AtomicSlider1.[Step].ToString()
  13:              End If
  14:          End Sub
  15:          Protected Sub SetStep_Click(sender As Object, e As EventArgs)
  16:              If Validation.IsValid Then
  17:                  AtomicSlider1.[Step] = Convert.ToInt32(StepToInc.Text)
  18:              End If
  19:          End Sub
  20:      End Class
  21:  End Namespace