Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / April 2008

Tip: Looking for answers? Try searching our database.

Delete record

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
CreativeMind - 31 Mar 2008 17:45 GMT
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:return 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.

            }

        }
Arnab das - 01 Apr 2008 10:56 GMT
> hi all,
> private void dgMygrid_ItemCreated(object sender,
[quoted text clipped - 13 lines]
>
>                 }

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();
}

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.