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

program to bring a window to the front

1571


Code to Block submission of form by pressing Enter Key

2085


sample code to auto focusing the first field in a form

2033


code to Hide and Show form controls

1811


I have a doubt regarding including tags in a function. I have written a function in javascript in a html page. The function got called by clicking a button, i want to display the results in same html page by placing tags in the function. (this hmtl page is static page) Is this possible? example:


How to encode and decode URL strings?

1801


code to detect availability of cookies

1787


code to images to rollover

1860


how to get the User's Time of Day

1676


function to combine two or more arrays

1708


how to create a Custom Scrollbar

2055


code to get the coordinates of a Click Event

1742


program to show a progress bar

2127


how to pass data between pages using Cookies

1852


write a code to generate pseudorandom numbes

1791