views:

100

answers:

1

I have added a custom button to the server ribbon in SharePoint (I have used a feature with Farm scope, so that the button is visible throughout the various site collections).

For the elements of the feature, I have added a CustomUIExtension through which I want to load an aspx page on the click of the button.

<CommandUIHandler
    Command="Test_Button"
    CommandAction="javascript:
      function demoCallback(dialogResult, returnValue)
      {
        SP.UI.Notify.addNotification('Operation Successful!');
        SP.UI.ModalDialog.RefreshPage(SP.UI.DialogResult.OK);
      }

      var options = {              
              url: '/_layouts/CustomPage.aspx',
              tite: 'Custom Page',
              dialogReturnValueCallback: demoCallback };
      SP.UI.ModalDialog.showModalDialog(options);" 
/>

I have added the CustomPage.aspx and its corresponding code behind class to the 14 hive (inside 14/TEMPLATE/LAYOUTS). However when I install the feature and click the button, I get an error saying "Cannot load CustomPage".

I understand that I haven't deployed the assembly, but shouldn't the aspx page be compiled Just In Time?

A: 

I guess your .aspx file is looking for the assembly (.dll) and not the .cs from which it is inheriting currently in the .aspx file.

Please put your assembly in the bin folder of your application and remove the inherits tage from your .aspx page

Raj