Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Delete record

Reply
Thread Tools

Delete record

 
 
CreativeMind
Guest
Posts: n/a
 
      03-31-2008
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.

}

}
 
Reply With Quote
 
 
 
 
Arnab das
Guest
Posts: n/a
 
      04-01-2008
On Mar 31, 9:45*pm, CreativeMind <aftab.pu...@gmail.com> wrote:
> 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();
}
 
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
Updating a Record using a current record MRW ASP .Net 0 02-11-2008 06:58 PM
IP Address, MX Record, A Record Question K.J. 44 Cisco 2 09-06-2006 05:14 PM
You cannot add or change a record because a related record is required in table 'lok" André ASP .Net 0 06-25-2006 01:30 PM
Retrieving Record Key while creating the record. =?Utf-8?B?SnVzdGlu?= ASP .Net 4 10-05-2004 08:11 PM
" Invalid Disk Table in Boot Record - Boot Record could not be repaired " reply@newsgroup.please Computer Support 2 12-01-2003 05:37 AM



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