Horje
how to use combo box to find age in c# Code Example
how to use combo box to find age in c#
protected void btn_Click(object sender, EventArgs e)
    {
         // here you use your ddl,combobox or etc where age date is inserted
        DateTime dtStart = DateTime.Parse(txtDoB.Text);
        TimeSpan sp = DateTime.Now - dtStart;
        int year = "18";
        int days = 365;
        int total = year * days;

        if (sp.Days < total)
        {

            txtDoB.Text = "Not Valid";
            lblMess.Text = "You can not be under 18 years";
            lblMess.CssClass = "Errr";
            return;
        }
}




Csharp

Related
boucle C# Code Example boucle C# Code Example
C# walk down a tree and back Code Example C# walk down a tree and back Code Example
.netstandard distinctby iqueryable Code Example .netstandard distinctby iqueryable Code Example
Winform on exit run method Code Example Winform on exit run method Code Example
c# directory entry invoke Code Example c# directory entry invoke Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8