Skip to content

Instantly share code, notes, and snippets.

@JasonOffutt
Last active December 14, 2015 23:19
Show Gist options
  • Save JasonOffutt/5165305 to your computer and use it in GitHub Desktop.
Save JasonOffutt/5165305 to your computer and use it in GitHub Desktop.
Emitting values in HTML...
<h3 class="header-text" >Confirm your Contribution: </h3>
<p><b><asp:Literal ID="lName" runat="server" /></b>, thank you for your generosity! You are about to give a gift totalling <b><asp:Literal ID="lTotal" runat="server"/></b> to the following funds:</p>
<asp:Repeater ID="rptGifts" runat="server">
<HeaderTemplate>
<ul>
</HeaderTemplate>
<ItemTemplate>
<li><%# Eval("Amount").ToString("C") %> to the <%# Eval("Fund") %>.</li>
</ItemTemplate>
<FooterTemplate>
</ul>
</FooterTemplate>
</asp:Repeater>
<p>Your gift will be paid using your <b><asp:Literal ID="lCardType" runat="server"/></b> credit card ending in <b><asp:Literal ID="lLastFour" runat="server"/></b>.</p>
protected void btnNext_Click( object sender, EventArgs e )
{
var firstTrans = _transactions.First();
lName.Text = person.FullName;
lTotal.Text = _transactions.Sum( t => t.Amount ).ToString("C");
lCardType.Text = firstTrans.CardType;
lLastFour.Text = firstTrans.CardNumber.Substring( firstTrans.CardNumber.length - 4 );
rptGifts.DataSource = _transactions;
rptGifts.DataBind();
pnlDetails.Visible = false;
pnlConfirmation.Visible = true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment