473,385 Members | 1,409 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.

Delete record

hi all,
private void dgMygrid_ItemCreated(object sender,
System.Web.UI.WebControls.DataGridItemEventArgs e)
{

Button bDelete=(Button)e.Item.FindControl("btnDelete");
if(bDelete!=null)
{
bDelete.Attributes.Add("OnClick","javascript:retur n confirm('Are
you sure you want to delete this sales person?');");
// if user clicks ok, then i want to call deleteRecord(); Question is
how i trace 'ok'?
ie. // if ok then delete record else do nothing.

}

}
Mar 31 '08 #1
1 1599
On Mar 31, 9:45*pm, CreativeMind <aftab.pu...@gmail.comwrote:
hi all,
private void dgMygrid_ItemCreated(object sender,
System.Web.UI.WebControls.DataGridItemEventArgs e)
* * * * * * * * {

* * * * * * * * * * * * Button bDelete=(Button)e..Item.FindControl("btnDelete");
* * * * * * * * * * * * if(bDelete!=null)
* * * * * * * * * * * * {
* * * * * * * * * * * * * * * * bDelete.Attributes.Add("OnClick","javascript:retur n confirm('Are
you sure you want to delete this sales person?');");
// if user clicks ok, then i want to call deleteRecord(); Question is
how i trace 'ok'?
ie. // if ok then delete record else do nothing.

* * * * * * * * * * * * }

* * * * * * * * }
call a javascript function form onclinetclick for the "btnDelete"
button.
Inside the function write the following code
function confirm()
{
var returnvalue = window.confirm('Are you sure you want to delete
this sales person?');");
return returnvalue ;
}

in code behind write
private void dgMygrid_ItemCreated(object sender,
System.Web.UI.WebControls.DataGridItemEventArgs e)
{

Button
bDelete=(Button)e.Item.FindControl("btnDelete");
//delete function();
}
Apr 1 '08 #2

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

Similar topics

1
by: Someonekicked | last post by:
I have a binary file, and I need to delete a specific number of characters in it. The file contains records, each record has a specific length. So the way I wanna handle deleting is that I will...
9
by: Robert Schneider | last post by:
Hi to all, I don't understand that: I try to delete a record via JDBC. But I always get the error SQL7008 with the error code 3. It seems that this has something to do with journaling, since the...
8
by: Steve | last post by:
I have several pairs of synchronized subforms in an application. I have a Delete button for each pair that uses the following code or similar to delete a record in the second subform: ...
3
by: Uwe Range | last post by:
Hi to all, I am displaying a list of records in a subform which is embedded in a popup main form (in order to ensure that users close the form when leaving it). It seems to be impossible to...
3
by: Maria | last post by:
Is there another way to delete the current record in a subform from the main form, another subform or a sub-subform other than setting focus on a field in the subform and using run command...
4
by: Susan Bricker | last post by:
I have a command button on a form that is supposed to Delete the record being displayed. The record is displayed one to a form. The form is not a Pop-Up nor is it Modal. Tracing the btnDelete...
5
by: Bob Bridges | last post by:
Start with two tables, parent records in one and child records in the other, a one-to-many relationship. Create a select statement joining the two. Display the query in datasheet mode. When I...
4
by: Craggy | last post by:
Hi, I am trying to pop up a yes/no message box so that a user can delete a record in a continuous form. The default delete message is a bit sloppy because it seems to move the continuous form to...
5
by: sh26 | last post by:
I can Add and Delete (A, CName, MX and TXT) Dns records on the Dns Server using C# code. The problem I am having is if someone manaully creates a TXT record on the Dns Server, I cannot delete that...
10
beacon
by: beacon | last post by:
Hi everybody, This is probably going to sound unorthodox, but I have to log records that are deleted...I know, go figure. Anyway, I have a form with a (continuous) subform, and on the subform I...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...

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.