Call method from FormView_Inserting method

Discussion in 'ASP .Net' started by sck10, Mar 12, 2007.

  1. sck10

    sck10 Guest

    Hello,

    I have two methods that I would like to use on the ItemInserting event
    (ItemInserting and ItemInserting_Validate). My question is what is the
    syntax for calling fvTravelTrack_ItemInserting_Validate from
    fvTravelTrack_ItemInserting. Also, will the cancel event in the
    ItemInserting_Validate method cancel everything, or should I send a string
    back to ItemInserting and cancel there based upon what is sent back?

    Thanks,

    sck10


    protected void fvTravelTrack_ItemInserting(object sender,
    FormViewInsertEventArgs e)
    {
    //Validate data
    this.fvTravelTrack_ItemInserting(Something, Something);
    }


    protected void fvTravelTrack_ItemInserting_Validate(object sender,
    FormViewInsertEventArgs e)
    {
    this.lblMessageText.Text = "<strong class='RedB'>Report
    Errors</strong>.<br />";

    //Validate Fields
    //---------------
    //Departure
    if (e.Values["Departure"].ToString() == "")
    {
    e.Cancel = true;
    this.lblMessageText.Text += "<span class='RedM'>Departure</span>:
    Location Missing.<br />";
    } // end if
    }
    sck10, Mar 12, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?ISO-8859-1?Q?Thomas_Gagn=E9?=
    Replies:
    9
    Views:
    11,215
    Jezuch
    Jul 3, 2003
  2. Ian
    Replies:
    2
    Views:
    343
    Ulrich Petri
    Sep 6, 2003
  3. Mac
    Replies:
    1
    Views:
    587
  4. sck10
    Replies:
    0
    Views:
    281
    sck10
    Mar 14, 2007
  5. sck10
    Replies:
    0
    Views:
    354
    sck10
    Mar 15, 2007
Loading...

Share This Page