Bharathi Level: Scholar
 Registered: 11-04-2005 Posts: 31
|
Re: Dialog boxes Of Asp.net
Hi,
The first and usual technique of implementing dialog box is to put javascript to the particular event (usually click event) of the control. Its really a easy way when your application already know when to open a dialog box when the page load to the browser.
Here is the simple example, put a button form control to the web page and insert the following code.
btnOpen1.Attributes.Add("onclick", "alert('GOT IT?');")
its a one line code to pop a alert message to the user.
Same way, suppose you want that, the application open a confirmation dialog box from where the user can select his option. You can use this method very well. Like, you want to open a confirmation dialog box when user click on the delete button of the page. Simply use following code for that :
btnDelete.Attributes.Add("onclick", "if(confirm('Are you sure to delete?')){}else{return false}")
it will create a small javascript code to the browser. When user select "No" from the confirmation dialog box, it will return false. Hence nothing will happen. And if user select "Yes", it will return true and will post the page.
Regards
bhar
books for programmers
http://www.vkinfotek.com
|