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

communication between main window and new windows

1901


Reading which Non-Character Key was pressed

1887


how to create a Draggable element

2121


Code to Block submission of form by pressing Enter Key

2277


how to pass data between pages using Frames

2364


write a code that user can choose/alter Body Text Size

1778


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

2003


determine which Element received an Event

2083


how to create a Custom Scrollbar

2240


snippet to prevent submission of form when certain/any validations got failed

1722


code to sorting an array of objects

2166


code to get the coordinates of a Click Event

1949


code to positioning of window in certain dimensions

1865


how to pass data between pages using Cookies

2054


code to set the main window's size

1919