GridView – BoundField currency data string format: DataFormatString=”{0:C}” Here is GridView – TemplateField currency data string format: <%# FormatCurrency(Convert.ToString(Container.DataItem(“PayOffAmt”)))%>
Archive for the 'ASP.NET' Tag
Databinder.Eval and Container.DataItem (VB)
Array of Strings: <%# Container.DataItem %> Field from DataView: <%# Container.DataItem(“FirstName”) %> Collection of objects: <%# Container.DataItem.FirstName %> Example <a href='<%# Databinder.Eval(Container.DataItem,”ID”,”default.aspx?CategoryId={0}” ) %>’> In case you use jQuery or Colorbox to open in a new window, here is example: <a class=”colorbox1” href='<%# “default.aspx?CategoryId=” + Cstr(Databinder.Eval(Container.DataItem, “CustomerID”))%>’> Recordset line number <%#Container.DataItemIndex + 1%>.
Login
~ Access db backend & SHA1 or MD5 encryption ~ Web.config <system.web> <authentication mode=”Forms”> <forms loginUrl=”Login.aspx” timeout=”2880″/> </authentication> </system.web> Login.aspx <form id=”form1″ runat=”server” > <table > <tr> <td colspan=”2″><b>Login Form</b></td> </tr> <tr> <td>Intranet Username: </td><td style=”color: Red;” > <asp:TextBox ID=”usn” runat=”server” TextMode=”password” /> <asp:RequiredFieldValidator ID=”ReqVal_1″ controltovalidate=”usn” validationgroup=”Login1″ runat=”server” ErrorMessage=” ? ” > </asp:RequiredFieldValidator> </td> </tr> […]