I have a Rad toolbar with with 5-7 buttons. couple of buttons like new, print, help work only client side and the client side click event opens up rad windows. the rest of the buttons do some server side work. there is one button (Delete), that requires a Rad Comfirm dialog to come up and on confirmation (OK) the javascript should let the button do server side code, (if Cancel it should just stop and return. ).
here is my Toolbar defination:
<rad
:RadToolbar ID="MainToolbar" runat="server" ButtonWidth="26px"
style="margin-bottom: 0px" ononclick="MainToolbar_OnClick"
AutoPostBack="True">
attchment of the client Side event handler:
window[userToolbar].attachEvent("OnClientClick","User_Toolbar_Click_Handler");
here is my Client Siode Javascript function:
var returnValue;
function User_Toolbar_Click_Handler(sender, e)
{
/// Toolbar Event handler of the user.aspx page.
switch(sender.CommandName)
{
case 'New':
window.radopen("DetailPages/UserDetails.aspx?isNew=true&userId=-1","PropertiesWindow");
return false;
break;
case 'ImportUsers':
doImportUsers();
return false;
break;
case 'Delete':
doDeleteUsers();
return returnValue;
break;
default :
radalert('Option not ready', '', 150,"Message");
return false;
}
return false;
}
function doImportUsers()
{
radconfirm('Are you sure you want to import Users from the LDAP store?', importUsersCallBack, 330, 100);
}
function doDeleteUsers()
{
radconfirm('Are you sure you want to Delete User?', deleteCallBack, 330, 100);
}
function deleteCallBack(arg)
{
returnValue = arg;
}
Question: either it does the client side code or it does ther server side code. never both together. what else is required to get the toolbar to work as we need it to?