Hi All,
Is it possible to popup a RadWindow when a RadToolBarButton is clicked in code behind.
I'm tried to do this by passing by a javascript function and then call the VB.NET function but it didn't work
Here's my code :
ASPX:
Code-Behind:
Thanks
Ahmed
Is it possible to popup a RadWindow when a RadToolBarButton is clicked in code behind.
I'm tried to do this by passing by a javascript function and then call the VB.NET function but it didn't work
Here's my code :
ASPX:
<telerik:RadScriptBlock runat=
"server"
ID=
"RadScriptBlock1"
>
<script type=
"text/javascript"
>
var
toolbar;
var
ajaxManager;
function
pageLoad() {
toolbar = $find(
"<%= RadToolBarApplication.ClientID %>"
);
ajaxManager = $find(
"<%=RadAjaxManager1.ClientID %>"
);
}
function
onButtonClicked(sender, args) {
var
commandName = args.get_item().get_commandName();
if
(commandName ==
"functionJS"
) {
PageMethods.VBFunction()
}
}
</script>
</telerik:RadScriptBlock>
....
<telerik:RadToolBar ID=
"RadToolBarApplication"
runat=
"server"
OnClientButtonClicked=
"onButtonClicked"
>
<Items>
<telerik:RadToolBarButton Text=
"button1"
CommandName=
"functionJS"
/>
</Items>
</telerik:RadToolBar>
Code-Behind:
<System.Web.Services.WebMethod()> Public Sub VBFunction()
Dim radWindow As New RadWindow
radWindow.ID =
"RadWindow8"
radWindow.AutoSize = True
radWindow.VisibleOnPageLoad = True
RadWindowManager1.Windows.Add(radWindow)
Me.form1.Controls.Add(radWindow)
End Sub
Thanks
Ahmed