Question: How to write a custom validation function in a seaprate class (C#) like Functions.cs, where the function can be called to validate the following from

How to write a custom validation function in a seaprate class (C#) like Functions.cs, where the function can be called to validate the following from the Code-Behind such as Validate()...... Can not use Validator.

In my aspx page, I need to validate these input:

How to write a custom validation function in a seaprate class (C#)

-The name, address, and phone number textboxes cannot be blank.

-The user must select an option to either pickup their order or have it delivered.

-The user must select at least one pizza before completing the order. This means they need to add a checkmark to at least one row in the GridView for a PizzaType.

-A quantity must be entered for every PizzaType that is checkmarked in the GridView.

div> casp: Label ID "1b1Name" runat "server" Text "Name: "> casp:TextBox IDa "txtName" runat "server" >x/asp: Textbox> Kasp: Label ID-"1blAddress" runat-"server" Text-"Address: "x/asp: Label> asp : Label ID="1b1PhoneNumber" runat-"server" Text-"Phone #: ">Label) asp :TextBox ID="txtPhoneNumber" runate" server" >: TextBox> /asp:Label> Kasp:RadioButtonList ID-"rdblMethod" runat-"server"> asp:TemplateField HeaderText "Select Pizza Type"> asp:CheckBox ID:"chkSelect" runat="server" /> plateField> casp: BoundField DataFielda "PizzaType" HeaderTexts "Pizza Type">/asp:BoundField> Small Medium plateField> asp :TemplateField HeaderText-"Quantity"> casp:TextBox IDa"txtQuantity" runat"server"x/asp:TextBox> plateField>

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!