Execute a sub function in gridview

  • Thread starter Thread starter Deere
  • Start date Start date
D

Deere

Keep in mind I'm an old guy who is learning .net.

In asp classic I had a trash can icon in my shopping cart that would
delete a record.

In trying to accomplish the same in gridview I've used a template
column serveral different ways to try and execute a sub function in my
code behind and in a class... to no avail. It seems if I use a eval()
I need a return.

Would someone point me where I could see some code to do this.

Or point out the error in my thinking and show me the narrow path.

Thanks
 
Very simple.

In Add/Remove Columns of GridView, select one command column name "Delete"
and make it available for gridview. Now on delete click, it will call
delete method define in DataSource and will delete record from your table
automatically.

If you want to manually call your delete command, you can write in
GridView_ItemCommand which will be fired with command name on "Delete" link
click.

Contact me on my MSN messenger if you still need any help

Thanks
Shahzad Godil
Karachi-Pakistan
MSN Messenger : (e-mail address removed)
 
Shazad thanks, I will look at that and if I have any problems I will
let you know.

One question though, are you able to execute a general sub function
from within a gridview column. I can execute a regular function with a
return through the eval() method. But how about a non-returning sub
function.

thanks again
Mark
 
Back
Top