Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Sure</p> <p>ASPX part:</p> <pre><code> &lt;td&gt;&lt;asp:TextBox id="textBeginStation" runat="server"&gt;&lt;/asp:TextBox&gt;&lt;/td&gt; &lt;td&gt; &lt;asp:TextBox ID="textBeginServiceDateTime" runat="server"&gt;&lt;/asp:TextBox&gt; &lt;ajaxToolkit:MaskedEditExtender ID="textBeginServiceDateTimeMaskedEditExtender" runat="server" TargetControlID="textBeginServiceDateTime" MaskType="DateTime" Mask="9999/99/99 99:99" UserDateFormat="YearMonthDay" UserTimeFormat="TwentyFourHour"&gt; &lt;/ajaxToolkit:MaskedEditExtender&gt; &lt;/td&gt; &lt;td&gt; &lt;asp:TextBox ID="textBeginStationDateTime" runat="server"&gt;&lt;/asp:TextBox&gt; &lt;ajaxToolkit:MaskedEditExtender ID="textBeginStationDateTimeMaskedEditExtender" runat="server" TargetControlID="textBeginStationDateTime" MaskType="DateTime" AutoComplete="False" Mask="9999/99/99 99:99" UserDateFormat="YearMonthDay" UserTimeFormat="TwentyFourHour" EnableViewState="False"&gt; &lt;/ajaxToolkit:MaskedEditExtender&gt; &lt;/td&gt; &lt;td&gt;&lt;asp:TextBox ID="textBeginRemarque" runat="server"&gt;&lt;/asp:TextBox&gt;&lt;/td&gt; </code></pre> <p>This is just a sample, the rest is pretty similar. This is part of a UserControl that gets included inside a UpdatePanel from MS AJAX</p> <p>The LinkButton Code:</p> <pre><code>ProductionDependencyFactory depFactory = new ProductionDependencyFactory(); try { DateTime beginServiceDateTime = DateTime.Parse(textBeginServiceDateTime.Text); DateTime beginStationDateTime = DateTime.Parse(textBeginStationDateTime.Text); DateTime endServiceDateTime = DateTime.Parse(textEndServiceDateTime.Text); DateTime endStationDateTime = DateTime.Parse(textEndStationDateTime.Text); NormalTrainTimeMilageCalculator calculator = depFactory.Create&lt;NormalTrainTimeMilageCalculator&gt;(); calculator.BeginStation = textBeginStation.Text; calculator.BeginServiceDateTime = beginServiceDateTime; calculator.BeginStationDateTime = beginStationDateTime; calculator.EndStationDateTime = endStationDateTime; calculator.EndServiceDateTime = endServiceDateTime; calculator.EndStation = textEndStation.Text; labelTotalHour.Text = calculator.TotalTime().Hours.ToString(); labelTotalMinute.Text = calculator.TotalTime().Minutes.ToString(); labelTotalMilage.Text = calculator.TotalMilage().ToString(); } catch (Exception) { // Do nothing } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload