Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Calling C# user-defined function in javascript

Reply
Thread Tools

Calling C# user-defined function in javascript

 
 
=?Utf-8?B?TXBob3ph?=
Guest
Posts: n/a
 
      08-06-2004
Hi! Programmers,,,,,,

Scenario
I have a DataGrid with the delete button, If the user delete the row I'd
like to show a confirmation dialog box with two buttons(Yes,No). If the user
click yes the program must call my user-defined function to delete the row
from database.

The problem is I do not know how to create a confirm on deletes in a datagrid.

Can somebody help?


Thanks
Mpho

 
Reply With Quote
 
 
 
 
Martin Marinov
Guest
Posts: n/a
 
      08-06-2004
Hi there,

you have to do this in two steps:
1. when creating the datagrid, you have to add to Attributes collection of
the button that will call the delete command onclick ( not the server event,
but javascript ) that should contains something like

onclick="return confirmation('Are you really want to do that?');"
when the user click the button this line will popup a confirmation box. if
the user clicks No, then the page will not be submited. if the user clicks
OK the page will submited

2. you have to create a Delete command event or to create ItemCommand event
and check which is the command of the button that was pressed

using this you will know that if the poage is submitted and the .net enters
in the Command event ( Item or Delete ), the user was accepts the
confirmation

Regards
Martin

"Mphoza" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi! Programmers,,,,,,
>
> Scenario
> I have a DataGrid with the delete button, If the user delete the row I'd
> like to show a confirmation dialog box with two buttons(Yes,No). If the

user
> click yes the program must call my user-defined function to delete the row
> from database.
>
> The problem is I do not know how to create a confirm on deletes in a

datagrid.
>
> Can somebody help?
>
>
> Thanks
> Mpho
>



 
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
write a function such that when ever i call this function in some other function .it should give me tha data type and value of calling function parameter komal C++ 6 01-25-2005 11:13 AM
calling virtual function results in calling function of base class... Andreas Lagemann C++ 8 01-10-2005 11:03 PM
calling virtual function results in calling function of base class ... tiwy C++ 0 01-09-2005 11:17 PM
output text in control location; calling control javascript from page javascript Lisa Calla ASP .Net Building Controls 0 11-09-2004 02:17 AM
Calling Javascript function Krishna ASP .Net 5 07-09-2003 02:23 PM



Advertisments