Hello,
I'm trying to implement an extra toolbar button in my RadEditor that will call my codebehind via a Page Method and submit some content. We're using Master Pages and I have my RadScriptManager on the master page:
<telerik:RadScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true" />
for my RadEditor in my ASCX user control I have:
<telerik:EditorTool Name="SaveDesign" Text="SAVE" ShowText="true" ShowIcon="false" />
and further down:
<script type="text/javascript"> |
Telerik.Web.UI.Editor.CommandList["SaveDesign"] = function(commandName, editor, args) |
{ |
PageMethods.MySave("input string",CallSuccess,CallFail); |
}; |
function CallSuccess(results, userContext, methodName) |
{ |
alert(results); |
} |
function CallFail(errors, userContext, methodName) |
{ |
alert(errors.get_Message()); |
} |
</script> |
and in my codebehind I have:
[System.Web.Services.WebMethod()] |
public static string SaveShit(string stuff) |
{ |
return "did something"; |
} |
When I browse the page and click the toolbar button I get the error:
Error: 'PageMethods' is undefined
I'm kind of stuck with this, any help would be appreciated.