Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Execute a sub function in gridview

Reply
Thread Tools

Execute a sub function in gridview

 
 
Deere
Guest
Posts: n/a
 
      10-02-2006
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

 
Reply With Quote
 
 
 
 
Shahzad Godil
Guest
Posts: n/a
 
      10-02-2006

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 :



"Deere" <> wrote in message
news: s.com...
> 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
>



 
Reply With Quote
 
 
 
 
Deere
Guest
Posts: n/a
 
      10-02-2006
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

Shahzad Godil wrote:
> 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 :
>
>
>
> "Deere" <> wrote in message
> news: s.com...
> > 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
> >


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Death To Sub-Sub-Sub-Directories! Lawrence D'Oliveiro Java 92 05-20-2011 06:50 AM
Recognising Sub-Items and sub-sub items using xslt Ben XML 2 09-19-2007 09:35 AM
what's the differences between "Overrides Sub OnError" and "Sub Page_Error" ? Tee ASP .Net 2 07-09-2004 09:50 AM
Possible to terminate a sub that loads another sub? Kathy Burke ASP .Net 3 11-24-2003 02:01 PM
how do make a pop-up in sub ASP.net sub ? THY ASP .Net 1 08-18-2003 11:30 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57