Override formview objectdatasource method

J

jphaycock

I have a formview that uses an objectdatasource to insert and update
records. I don't want to use the objectdatasource's "Delete" method so
I have defined this method as "none" in the "configure datasource"
wizard.

I assumed I could use my own Delete Method by using the ItemCommand:

protected void FormViewModule_ItemCommand(object sender,
FormViewCommandEventArgs e)
{
if (e.CommandName == "Delete")
{
lblMessage.Text = "Deleted";
}
}

I just tried to set the text on a label to see if the event would fire
but I get this error message:

Deleting is not supported by ObjectDataSource 'ObjectDataSourceModule'
unless the DeleteMethod is specified

How do I force it to use my Delete Method instead of the
ObjectDataSource's Delete Method.

Thank you for any help

John
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top