Question

Guys I'm a student who knows simple stuff about Visual Basic Studio 2012 and who's working on creating an application for a course project. :)

I'm using ASP.Net Empty Website under Visual C# If that makes sense. xD

Anyways, I have 4 important yet simple questions:

Q1: how do I apply Password Custom Vlaidation? For example 8 characters min in both the password and the password confirm text feild?

Q2: How do I apply "required" validation to a group of radio buttons, check boxes and a drop down list?

Q3: In a form, how do I get a list of radio buttons appear as options for once a customer picks a hair style category, however if she picks a make up categorty from the same drop down list, a whole different options appear? I hope it's clear lol

Q4: Is there a "range" tool in Visual Basic 2012 and how do I use it?

I appreciate every answer and so much thanks in advance. :D

Was it helpful?

Solution

For ASP.NET

Ans1:

Use RegularExpressionValidator instead of CustomValidator

Ans2:

Use RequiredFieldValidator with all the controls. And in the last use single ValidationSummary Control to display message. Here is link for you Understanding ASP.NET Validation Techniques

Ans3:

Use RadioButtonList control for options. On SelectedIndexChange event of DropdownList control populate the RadioButtonList with relevant options.

Ans4:

Link in Ans2 will give you the RangeValidator control example.

OTHER TIPS

I assume you are working in Winform.

And Since I am a C# developer I am posting my code in C#. you can use Telerik Code Converter to convert it to VB.NET

Ans1:

char[] charArray = s.ToCharArray();

int passwordCharacters = charArray.Length;
if (passwordCharacters < 8)
{
    //Your code
}

Ans2:

Use ErrorProvider Control

Ans3:

There is no data bound RadioButtonList control in Winform. You will have to do it manually.

Ans4:

I don't think so there is any ASP.NET like Range Validator Control in VB.NET

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top