Action
 



Info
   1:  <%@ Page Title="AtomicRateStars -- Split" Language="C#" AutoEventWireup="true" CodeBehind="Split.aspx.cs" Inherits="Atom.Website.Samples.AtomicRateStars.Split" %>
   2:   
   3:  <%@ Register Src="../Source.ascx" TagName="Source" TagPrefix="sample" %>
   4:  <%@ Register Assembly="Atom.Web" Namespace="Atom.Web.UI.WebControls" TagPrefix="atom" %>
   5:  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
   6:  <html xmlns="http://www.w3.org/1999/xhtml">
   7:  <head id="Header1" runat="server">
   8:      <link rel="Shortcut Icon" type="image/ico" href="../images/icon.png" />
   9:      <!-- The jQuery UI theme that will be used by the components. -->
  10:      <link href="../themes/base/jquery-ui.css" rel="stylesheet" type="text/css" />
  11:      <!-- jQuery runtime minified -->
  12:      <script src="../Scripts/jquery-1.9.1.js" type="text/javascript"></script>
  13:      <!-- jQuery UI runtime minified, client-side javascript of the components.-->
  14:      <script src="../Scripts/jquery-ui-1.10.3.custom.min.js" type="text/javascript"></script>
  15:      <!-- The AtomicRateStars theme extension -->
  16:      <link href="../Scripts/RateStars/jquery.rating.css" rel="stylesheet" type="text/css" />
  17:      <!-- The AtomicRateStars client-side javascript -->
  18:      <script src="../Scripts/RateStars/jquery.rating.pack.js" type="text/javascript"></script>
  19:      <!-- This style reference is needed only for the current example. -->
  20:      <link href="../css/example.css" rel="stylesheet" type="text/css" />
  21:   
  22:      <script type="text/javascript">
  23:          $(document).ready(function () {
  24:              $('#Save').button()
  25:   
  26:              var tb = $('#SplitBy').blur(function () {
  27:                  var newValue = parseInt(tb.val());
  28:   
  29:                  if (isNaN(newValue)) {
  30:                      alert("Invalid input");
  31:                  }
  32:              });
  33:          });
  34:      </script>
  35:  </head>
  36:  <body>
  37:      <form id="form1" runat="server">
  38:      <fieldset>
  39:          <legend>Action </legend>
  40:          <label for="Split">
  41:              Split by:</label>
  42:          <asp:TextBox runat="server" ID="SplitBy" />
  43:          <asp:Button Text="Split" runat="server" ID="Save" OnClick="Save_Click" /><br />
  44:          <asp:RegularExpressionValidator ID="Validation" runat="server" ControlToValidate="SplitBy"
  45:              Style='color: red' ErrorMessage="Please Enter Only Numbers" ValidationExpression="^\d+$"></asp:RegularExpressionValidator>
  46:      </fieldset>
  47:      <br />
  48:      <div>
  49:          <atom:AtomicRateStars ID="AtomicRateStars1" runat="server" ShowTitles="true" CancelButtonTitle="clear">
  50:              <RateItems>
  51:                  <atom:RateItem Selected="False" Title="one" Value="1" />
  52:                  <atom:RateItem Selected="False" Title="two" Value="2" />
  53:                  <atom:RateItem Selected="False" Title="three" Value="3" />
  54:                  <atom:RateItem Selected="False" Title="four" Value="4" />
  55:                  <atom:RateItem Selected="False" Title="five" Value="5" />
  56:                  <atom:RateItem Selected="False" Title="six" Value="6" />
  57:                  <atom:RateItem Selected="False" Title="seven" Value="7" />
  58:                  <atom:RateItem Selected="False" Title="eight" Value="8" />
  59:                  <atom:RateItem Selected="False" Title="nine" Value="9" />
  60:                  <atom:RateItem Selected="False" Title="ten" Value="10" />
  61:              </RateItems>
  62:          </atom:AtomicRateStars>
  63:      </div>
  64:      <br />
  65:      <sample:Source ID="Code" runat="server" />
  66:      </form>
  67:  </body>
  68:  </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.AtomicRateStars
   9:  {
  10:      public partial class Split : System.Web.UI.Page
  11:      {
  12:          protected void Page_Load(object sender, EventArgs e)
  13:          {
  14:              if (!IsPostBack)
  15:              {
  16:                  SplitBy.Text = AtomicRateStars1.Split.ToString();
  17:              }
  18:          }
  19:   
  20:          protected void Save_Click(object sender, EventArgs e)
  21:          {
  22:              if (Validation.IsValid)
  23:              {
  24:                  AtomicRateStars1.Split = Convert.ToInt32(SplitBy.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.AtomicRateStars
   8:      Public Partial Class Split
   9:          Inherits System.Web.UI.Page
  10:          Protected Sub Page_Load(sender As Object, e As EventArgs)
  11:              If Not IsPostBack Then
  12:                  SplitBy.Text = AtomicRateStars1.Split.ToString()
  13:              End If
  14:          End Sub
  15:          Protected Sub Save_Click(sender As Object, e As EventArgs)
  16:              If Validation.IsValid Then
  17:                  AtomicRateStars1.Split = Convert.ToInt32(SplitBy.Text)
  18:              End If
  19:          End Sub
  20:      End Class
  21:  End Namespace