To achieve client-side Radalert functionality, follow these steps:
Step 1: Layout.
On the web page, specify an instance of RadWindowManager. Without this radar, radio configuration, or radio reception. This is the basis of this feature. Here is the code snippet:
<telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableShadow="true"> </telerik:RadWindowManager>
Then place the regular button and handle its onclick event. Here is the code snippet:
<button style="width: 150px;" onclick="radalert('Radalert is called from the client!', 330, 100, 'Client RadAlert', alertCallBackFn, imgUrl); return false;"> radalert from client</button>
Note the callback for radlalert named "alertCallBackFn". We will code this function in the next section. Also note the use of the imgUrl variable variable. This defines the image to be used in radalert. We will see what he does in the next section.
Step 2: Javscript
Radalert requires an image to be displayed as part of the warning window. Declare a global variable named "imgUrl", as shown below:
//use custom image in the alert box var imgUrl = "http://www.telerik.com/favicon.ico"; //do not show any image in the alert box imgUrl = ""; //uses the default image in the alert box imgUrl = null;
Then create a radalert callback function, as shown below:
function alertCallBackFn(arg) { radalert("<strong>radalert</strong> returned the following result: <h3 style='color: #ff0000;'>" + arg + "</h3>", null, null, "Result"); }
Now, when you click the Radalert button, you will see a warning window that will be displayed with your text.
Hope this was the solution you were looking for.
Lohit (Technical Evangelist, Telerik India)