how prevent .net validators form interfering with navigator between tabbed pane
On page load, Tabbed pane 1 appears. The Tabbed pane 1 has 2 compare validator throws error message if i try to navigate between Tabbed pane 2 and 3, except when their condition is met.
What i want is for the compare validator to throw error only when the Add users button in tabbed pane 1 is clicked, so that i can easily navigate between Tabbed pane1,2 and 3 without any error message.
My CODE
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack){
BindUserDetails();
BindUserDetails1();
}
MainView.ActiveViewIndex = 0;
}
protected void Tab1_Click(object sender, EventArgs e)
{
Tab1.CssClass = "Clicked";
Tab2.CssClass = "Initial";
Tab3.CssClass = "Initial";
MainView.ActiveViewIndex = 0;
}
protected void Tab2_Click(object sender, EventArgs e)
{
Tab1.CssClass = "Initial";
Tab2.CssClass = "Clicked";
Tab3.CssClass = "Initial";
MainView.ActiveViewIndex = 1;
}
protected void Tab3_Click(object sender, EventArgs e)
{
Tab1.CssClass = "Initial";
Tab2.CssClass = "Initial";
Tab3.CssClass = "Clicked";
MainView.ActiveViewIndex = 2;
}
protected void BindUserDetails()
{
string constr = ConfigurationManager.ConnectionStrings["constr"].ConnectionString;
using (SqlConnection con = new SqlConnection(constr))
{
using (SqlDataAdapter sda = new SqlDataAdapter("Select id, category FROM AssetsCategory ORDER BY id ASC", con))
{
using (DataTable dt = new DataTable())
{
sda.Fill(dt);
gvDetails.DataSource = dt;
gvDetails.DataSource = dt;
gvDetails.DataBind();
}
}
}
}
protected void BindUserDetails1()
{
string constr = ConfigurationManager.ConnectionStrings["constr"].ConnectionString;
using (SqlConnection con1 = new SqlConnection(constr))
{
using (SqlDataAdapter sda1 = new SqlDataAdapter("Select id, Company FROM Suppliers ORDER BY id ASC", con1))
{
using (DataTable dt1 = new DataTable())
{
sda1.Fill(dt1);
grid1.DataSource = dt1;
grid1.DataSource = dt1;
grid1.DataBind();
}
}
}
}
protected void ImageButton3_Click(object sender, ImageClickEventArgs e)
{
}
protected void Inkview_Click(object sender, EventArgs e)
{
}
protected void Inkview_Click1(object sender, EventArgs e)
{
}
protected void Button4_Click(object sender, EventArgs e)
{
}
protected void Button5_Click(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
}