using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class ApplyNow : System.Web.UI.Page
{
private String dob;
{
private String dob;
protected void btn_applyNow_Click(object sender, EventArgs e)
{
if (getDob())
{
if (isAvailable(txt_emailAddress.Text))
insertStudent();
else
lbl_error.Text = "Email already exists";
}
else
{
lbl_error.Text = "Please enter valid date";
}
}
{
if (getDob())
{
if (isAvailable(txt_emailAddress.Text))
insertStudent();
else
lbl_error.Text = "Email already exists";
}
else
{
lbl_error.Text = "Please enter valid date";
}
}
private bool getDob()
{
dob = ddl_month.SelectedValue + " " + ddl_day.SelectedValue + ", " +
ddl_year.SelectedValue;
try
{
DateTime.Parse(dob);
return true;
}
catch
{
return false;
}
}
{
dob = ddl_month.SelectedValue + " " + ddl_day.SelectedValue + ", " +
ddl_year.SelectedValue;
try
{
DateTime.Parse(dob);
return true;
}
catch
{
return false;
}
}
private void insertStudent()
{
{
//coding
}
}
}
**************************LINKS******************************
I have created a new better blog:
My Youtube channel:
**************************LINKS******************************