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


Top 5 Contributors of the Month
david stephan

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
Hi,

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

Thanks
Priya

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

Hello
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
http://geekswithblogs.net/dotNETvinz/archive/2009/02/22/gridview-multiple-delete-with-checkbox-and-confirm.aspx

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

Lalit.


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
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

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