Home » 2011 » June

Archive for June, 2011

Form Drop-down-list binding

Learn how to make easy drop-down-list with a list of different choices and binding the existing data with the form. Screenshot speaks for itself.

Form Validation

Regular Expression Validator – Date Validation TextBox Control <asp:TextBox ID=”REF_PAID_DATETextBox” runat=”server”  Text='<%# Bind(“REF_PAID_DATE”) %>’ ToolTip=”Use MM/DD/YYYY format”  class=”myTextBox75″ ></asp:TextBox> Regular Expression Validator <asp:RegularExpressionValidator ID=”REF_PAID_DATEFormat” runat=”server” ValidationExpression=”^\d{1,2}/\d{1,2}/\d\d\d\d$” ControlToValidate=”REF_PAID_DATETextBox” ValidationGroup=”Form1″ Text=” <font color=’red’> mm/dd/yyyy </font>” ErrorMessage=”<font color=’red’> mm/dd/yyyy </font>”> </asp:RegularExpressionValidator> Submit Button <asp:Button ID=”UpdateButton” runat=”server” CausesValidation=”True” ValidationGroup=”Form1″ CommandName=”Update” Text=”Update” />

.NET Form/GridView Update Command Property

Insert this code right below <!DOCTYPE html PUBLIC “…..”> tag: Sub UpdateMessage(ByVal source As Object, ByVal e As SqlDataSourceStatusEventArgs) If e.AffectedRows > 0 Then ‘ Perform any additional processing, ‘ such as setting a status label after the operation. Label1.Text = “- Information updated successfully!” Else Label1.Text = “No data updated!” End If End Sub […]