.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Kaviya Balasubramanian
Sgraph Infotech
Imran Ghani

Home >> Forum >> ASP.Net >> Post New QuestionBookmark and Share Subscribe to Forum

Javascript alert with yes and no button in in gridview in asp.net

Posted By: priya     Posted Date: March 29, 2010    Points:2   Category :ASP.Net

I need to display message box alert with yes or No button in javascript. I need to send user confirmation message in gridview while deleting the records


Author: Suresh          Accepted Answer   
Posted Date: March 29, 2010     Points: 10   

Kindly add below code in Row databound event

protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
if (e.Row.RowType == DataControlRowType.DataRow)
LinkButton LinkButtonDelete = (LinkButton)e.Row.FindControl("LinkButton2");
LinkButtonDelete.Attributes.Add("onclick", "return confirm('Are you sure you want to delete?');");

I hope, it vil give soultion to your query.

Author: priya             
Posted Date: March 30, 2010     Points: 5   

Thanks a lot Suresh

Author: Lalij Mer             
Posted Date: March 30, 2010     Points: 5   

complete article you can show here

Please Check my answer if you help....
Thank You...


Post Reply

You must Sign In To post reply
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend