473,769 Members | 5,900 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2567
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('A re 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****@discuss ions.microsoft. com> wrote in message
news:56******** *************** ***********@mic rosoft.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
2416
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. Generally, the documentation suggests that queues or similar constructs should be used for thread inter-process comms. I've had a lot of success in doing that (generally by passing in the queue during the __init__ of the thread) and I can see...
2
2219
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 is an anonymous Internet user accessing the ASP page? Any help/advice would be appreciated about potential problems/concerns when calling an exe from an ASP and then subsequently accessing a database from within that exe. Is there a problem...
0
1220
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 other servers. I have now moved it to the live one and its not working. The error I was getting was the really great and useful "Unspecified error". The stack trace was:
8
17491
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 request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.IO.IOException: The directory name is invalid.
2
408
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 page and somehow the managed code is working OK but when it arrives the part of the code where it is calling the un-managed .dll it gets an exception (it can't find the dll). Is it a security problem? if it is what do I do to solve it? Is it a...
0
1664
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 Forms user control in my HTML page (a .NET alternative to good old ActiveX). I’d like to use my control to call web-services instead of using behaviours (webservices.htc).
7
6606
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 written in C++ and it's calling a java application. This application displays a window and pushing a button is calling back the c++-plugin again.
0
1372
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 switched the call to a synch, the client app got the error message and displayed it nicely to the user. In this client app. the user does not have to do anything while waiting for results to come back from the web, so it makes sense to call the...
0
1020
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. Now I want to call this exe from web, for that I have set up asp.net application, using the process class of the System.Diagnostics namespace, it is calling exe. Its is also working great when I run this from the ASP.Net Development Server. But...
0
2094
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 able to display a list of installed instances for the user to be able to pick which instance they would like to configure. I was hoping to do this by calling MsiEnumProductsEx passing in the product code of my application. However, I receive the...
0
9586
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10043
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9990
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9861
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5298
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5446
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3956
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3561
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.