Events: clear log container


Info
   1:  <%@ Page Title="AtomicRateStars -- ServerSideEvents" Language="C#" AutoEventWireup="true" CodeBehind="ServerSideEvents.aspx.cs"
   2:      Inherits="Atom.Website.Samples.AtomicRateStars.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:      <!-- The AtomicRateStars theme extension -->
  17:      <link href="../Scripts/RateStars/jquery.rating.css" rel="stylesheet" type="text/css" />
  18:      <!-- The AtomicRateStars client-side javascript -->
  19:      <script src="../Scripts/RateStars/jquery.rating.pack.js" type="text/javascript"></script>
  20:      <!-- This style reference is needed only for the current example. -->
  21:      <link href="../css/example.css" rel="stylesheet" type="text/css" />
  22:   
  23:      <script type="text/javascript">
  24:          function ClearLogContainer() {
  25:              $("#<%= LogContainer.ClientID %>").val('');
  26:          }
  27:      </script>
  28:  </head>
  29:  <body>
  30:      <form id="form1" runat="server">
  31:      <div>
  32:          <atom:AtomicRateStars ID="AtomicRateStars1" runat="server" OnSelectedRateItem="AtomicRateStars1_SelectedRateItem"
  33:              OnSelectingRateItem="AtomicRateStars1_SelectingRateItem">
  34:              <RateItems>
  35:                  <atom:RateItem Selected="False" Title="NewHeader_0" Value="NewHeader_0" />
  36:                  <atom:RateItem Selected="False" Title="NewHeader_1" Value="NewHeader_1" />
  37:                  <atom:RateItem Selected="False" Title="NewHeader_2" Value="NewHeader_2" />
  38:                  <atom:RateItem Selected="False" Title="NewHeader_3" Value="NewHeader_3" />
  39:                  <atom:RateItem Selected="False" Title="NewHeader_4" Value="NewHeader_4" />
  40:              </RateItems>
  41:          </atom:AtomicRateStars>
  42:      </div>
  43:      <br />
  44:      <br />
  45:      <fieldset>
  46:          <legend>Events:</legend><a href="javascript:void(0);" style="float: right;" onclick="ClearLogContainer()">
  47:              clear log container</a>
  48:          <asp:TextBox ID="LogContainer" runat="server" TextMode="MultiLine" Width="100%" Text=""
  49:              Height="150px"></asp:TextBox>
  50:      </fieldset>
  51:      <br />
  52:      <sample:Source ID="Code" runat="server" />
  53:      </form>
  54:  </body>
  55:  </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.AtomicRateStars
  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 AtomicRateStars1_SelectedRateItem(object sender, SelectedRateItemEventArgs e)
  19:          {
  20:              LogContainer.Text += string.Format("SelectedRateItem at {0}\n", DateTime.Now.ToString("HH:mm:ss"));
  21:          }
  22:   
  23:          protected void AtomicRateStars1_SelectingRateItem(object sender, SelectingRateItemEventArgs e)
  24:          {
  25:              LogContainer.Text += string.Format("SelectingRateItem at {0}\n", DateTime.Now.ToString("HH:mm:ss"));
  26:          }
  27:   
  28:   
  29:      }
  30:  }
   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.AtomicRateStars
   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 AtomicRateStars1_SelectedRateItem(sender As Object, e As SelectedRateItemEventArgs)
  14:              LogContainer.Text += String.Format("SelectedRateItem at {0}" & vbLf, DateTime.Now.ToString("HH:mm:ss"))
  15:          End Sub
  16:          Protected Sub AtomicRateStars1_SelectingRateItem(sender As Object, e As SelectingRateItemEventArgs)
  17:              LogContainer.Text += String.Format("SelectingRateItem at {0}" & vbLf, DateTime.Now.ToString("HH:mm:ss"))
  18:          End Sub
  19:      End Class
  20:  End Namespace