title: how to get the clicked button event id
body: <p>Hi i need to get the event id in this table which when the btnStopEvent is clicked its gets the current time and displays it into the same table,i the Endtime Column e.g i have 5 events id 1,2,3,4,5 when the user click the button in column 2 it should display the current time in EndTime Column, Here is what i have for now</p>
  
  <pre><code>function GetStartUserData() {
          var IPAddress = $('#IPAddress').text();
          (IPAddress == '' ? null : 'ipaddress=' + IPAddress)
          var EventId = '';
          var Category = $('#categories').val();
          var ExtraData = $('#txtcomment').val();
  
          return {
            MachineName: IPAddress
          , EventId: EventId
          , CategoryName: Category
          , Comments: ExtraData
  
          }
  }
  
  
  function DisplayStartData(downTimeStart) {
       console.log(downTimeStart);
       var newContent = '';
  
          $.each(downTimeStart.data, function (i, item) {
              newContent += Hesto.Html.StartTR(item.downTimeStart);
              newContent += Hesto.Html.CreateTD('&lt;input type="button" value="Stop" id="btnStopEvent"&gt;');
              newContent += Hesto.Html.CreateTD(item.EventId);
              newContent += Hesto.Html.CreateTD(item.CategoryName);
              newContent += Hesto.Html.CreateTD(item.StartTime);
              newContent += Hesto.Html.CreateTD(item.EndTime);
              newContent += Hesto.Html.CreateTD(item.Comments);
              newContent  = Hesto.Html.EndTR(newContent);
          });
          $('#DowntimeList').append(newContent);     
   }
  </code></pre>
  
  <p>HTML:</p>
  
  <pre><code>&lt;div id="panel"&gt;&lt;table id="Downtimetable" class="hesto"&gt;
              &lt;thead&gt;
                   &lt;tr&gt;
                       &lt;th&gt;END OF DOWNTIME&lt;/th&gt; 
                       &lt;th&gt;Event ID&lt;/th&gt;                  
                       &lt;th&gt;CATEGORY NAME&lt;/th&gt;             
                       &lt;th&gt;START TIME&lt;/th&gt;
                       &lt;th&gt;END TIME&lt;/th&gt;
                       &lt;th&gt;COMMENTS&lt;/th&gt;
                   &lt;/tr&gt;
               &lt;/thead&gt;
               &lt;tbody id="DowntimeList"&gt;
  
               &lt;/tbody&gt;
               &lt;tfoot&gt;
               &lt;/tfoot&gt;
          &lt;/table&gt;&lt;/div&gt;
    &lt;div class="label" id="IPAddress"&gt;&lt;%Response.Write(Request.QueryString["ipaddress"]); %&gt;&lt;/div&gt;
  </code></pre>
  
  <p>json page </p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Configuration;
  using System.Web.Script.Serialization;
  using Hesto.SQL;
  using Hesto;
  
  
  public partial class services_json_DownTimeStartByMachineName : System.Web.UI.Page
  {
      protected void Page_Load(object sender, EventArgs e)
      {
          System.Collections.Specialized.NameValueCollection nvc = new System.Collections.Specialized.NameValueCollection();
          nvc.AddFromQueryString(Request.QueryString);
          nvc.AddFromQueryString("MachineName", Request.UserHostAddress, Request.QueryString);
          nvc.AddFromQueryString("EventId", "NULL", Request.QueryString);
          nvc.AddFromQueryString("CategoryName","NULL",Request.QueryString);
          nvc.AddFromQueryString("StartTime",DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),Request.QueryString);
          nvc.AddFromQueryString("Comments", "NULL", Request.QueryString);
  
          StoredProcedureCaller spc = new StoredProcedureCaller();
          spc.Execute(Request.QueryString, Resources.StoredProcedureDefinitions.DownTimeStartTimeByMachineName, Resources.ConnectionStrings.HESTOTESTING);
  
          Response.Write(spc.ToString("json"));
      }
  }
  </code></pre>
  
  <p>json page</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Configuration;
  using System.Web.Script.Serialization;
  using Hesto.SQL;
  using Hesto;
  
  public partial class services_json_DownTimeStop : System.Web.UI.Page
  {
      protected void Page_Load(object sender, EventArgs e)
      {
          System.Collections.Specialized.NameValueCollection nvc = new System.Collections.Specialized.NameValueCollection();
          nvc.AddFromQueryString(Request.QueryString);
          nvc.AddFromQueryString("EventId","", Request.QueryString);
          nvc.AddFromQueryString("EndTime", DateTime.Now.ToString(), Request.QueryString);
  
          StoredProcedureCaller spc = new StoredProcedureCaller();
          spc.Execute(nvc, Resources.StoredProcedureDefinitions.DownTimeStopEvent, Resources.ConnectionStrings.HESTOTESTING);
          Response.Write(spc.ToString("json"));
      }
  }
  </code></pre>