S
sck10
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
}
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
}