473,385 Members | 1,736 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Calling C# user-defined function in javascript

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

Nov 18 '05 #1
1 2539
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" <Mp****@discussions.microsoft.com> wrote in message
news:56**********************************@microsof t.com...
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

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Matthew Bell | last post by:
Hi, I've got a question about whether there are any issues with directly calling attributes and/or methods of a threaded class instance. I wonder if someone could give me some advice on this. ...
2
by: Earl | last post by:
If calling an exe that accesses a database from an ASP page, does the Provider string to connect to the database from inside the exe need to have the user as being "IUSR..." or something since it...
0
by: Andrew Daniels | last post by:
I am having a problem calling a 3rd party COM object in ASP.Net. My problem is happening when i try and create a instance of the object. The code and DLL are valid as has been working on several...
8
by: Glenn A. Harlan | last post by:
Why am I receiving the below error when calling - Path.GetTempFileName() The directory name is invalid. Description: An unhandled exception occurred during the execution of the current web...
2
by: b.bardugo | last post by:
Hi all, I have a C# user control (a little app I made to display video). In this code I am using a third party .dll, which is written in C++ (un-managed). I am tring to put this control on a web...
0
by: Michael Brandt Lassen | last post by:
Hi gurus This problem is about calling Web services secured by Forms Authentication from Windows Forms user controls embedded in HTML. Using the object tag I’ve managed to include a Windows...
7
by: Klaus Friese | last post by:
Hi, i'm currently working on a plugin for Adobe InDesign and i have some problems with that. I'm not really a c++ guru, maybe somebody here has an idea how to solve this. The plugin is...
0
by: Patino | last post by:
I have a particular WS consumer application (Windows app) that was not able to read an error from the WS app because it was calling a method asynch. The client app just hangs there. But once I...
0
by: pratikkagda | last post by:
Hi, I have created desktop applications in visual basic .net (Framework 2.0) which access the web information from a particular site. This application is working great. There is no problem at all....
0
by: Mike | last post by:
I have a new installer that allows the same product to be installed multiple times on the same machine. I also have a configuration program in .NET 2.0 SP1. I would like the config program to be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.