How to Add Message and Confirmation Boxes Using JavaScript?

Answer Posted / guest

public void AddConfirmMessage(WebControl ctl, string
message)
{
ctl.Attributes.Add("onclick", "if ( ! confirm( '"
+ message + "' )) return false; ");
}

public void AddPopupMessage(WebControl ctl, string message)
{
ctl.Attributes.Add("onclick", "alert( '" + message
+ "'); ");
}

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

code to get the coordinates of a Click Event

1738


Reading which Non-Character Key was pressed

1681


Create a Menu that can be activated while clicking on Right Mouse button

1698


how to create Expandable and Collapsible Menus

2652


how to Auto Scroll the page

1627






how to convert between arrays and strings

2104


sample code to auto focusing the first field in a form

2025


how to copy form data between different pages

1670


program to bring a window to the front

1556


How to block double clicks

1619


code to Hide and Show form controls

1799


advance the focus to next consecutive fields when Enter Key is pressed

1791


code to keep a page Out of the browser history

1649


how to get the User's Time of Day

1662


Create a ViewState Property?

2279