locked
Custom page filtering blocked by validation RRS feed

  • Question

  • User1980140492 posted

    Dear,

    I'm writing a custom page where I'm completely using my own filtering system which works in all cases, but one.
    This is when the filtered result returns 0 rows and this changes the detailformview its mode to insert. Now when I change my filters and click my search button again it'll give validation warnings because it thinks i'm inserting a new record, but I'm not.

    So the question is: how do I disable the validation and then enable it again later?

    Thanks in advance,
    - Yannick

    Tuesday, July 12, 2011 4:07 AM

Answers

  • User-330204900 posted

    You need to make sute the buttons your are using on your custom page have CausesValidation="False" set on them (just on the none Data Controls i.e. on your filtering).

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, July 12, 2011 9:50 AM

All replies

  • User1980140492 posted

    Okay I could do this:

    protected void GridView1_DataBound(object sender, EventArgs e)        
    {
    //if (GridView1.Rows.Count == 0)
    //{
    // FormView1.ChangeMode(FormViewMode.Insert);
    //}
    }

    but I'd like to hear another solution :) ...

    Tuesday, July 12, 2011 4:26 AM
  • User-330204900 posted

    You need to make sute the buttons your are using on your custom page have CausesValidation="False" set on them (just on the none Data Controls i.e. on your filtering).

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, July 12, 2011 9:50 AM
  • User1980140492 posted

    Cheers that's what I wanted to hear :)

    Tuesday, July 12, 2011 10:15 AM