samedi 18 avril 2015

Redirecting to previous page by avoiding required field validation

i have 3 pages



  1. Login

  2. Home

  3. Add employee

    Now i've a back button in "Add Employee" page which should redirect to the previous page! but when i click on it the required field validators will turn on!! how can i avoid that for back button?

    I tried using two types of code but both gets stuck in there for validation.





protected void Button2_Click(object sender, System.EventArgs e)
{
string prevPage = Request.UrlReferrer.ToString();
Response.Redirect(prevPage);
}


And this



protected void Button2_Click(object sender, EventArgs e)
{
Response.Redirect("home.aspx");
}

Aucun commentaire:

Enregistrer un commentaire