Question: I'm creating simple Magento module based on [this article](http://www.magentocommerce.com/wiki/5_-_modules_and_development/0_-_module_development_in_magento/custom_module_with_custom_database_table).  

I have a problem with my admin **New Item** action.

```
<?php

class Namespace_Gallery_Adminhtml_GalleryController extends Mage_Adminhtml_Controller_Action
{
protected function _initAction()
{
    $this->loadLayout()
        ->_setActiveMenu('namespace/gallery');

    return $this;
}

public function indexAction()
{
    $this->_initAction();
    $this->_addContent($this->getLayout()->createBlock('gallery/adminhtml_gallery'));
    $this->renderLayout();
}

public function editAction()
{
    echo 'edit';
}

public function newAction()
{
    $this->_forward('edit');
}

```

Items indexAction works and displays my items, when I click on any item it returns 'edit' as intended. Unfortunately clicking "Add new item" gives 404 (url is good).

Any ideas?

Answer: 
This is actually quite subtle...

*On the surface*, the answer is simply "it adds the `SerializableAttribute` to the metadata for the class", where the purpose of `SerializableAttribute` is to advertise (to things like `BinaryFormatter`) that a type can be serialized. `BinaryFormatter` will refuse to serialize things that aren't explicitly advertised for serialization. This may be a consequence of `BinaryFormatter` being used to implement *remoting*, and to prevent data accidentally leaking across a remoting boundary.

Note that most serializers don't *care* about `SerializableAttribute`, so this *only* impacts things like `BinaryFormatter`. For example, none of `XmlSerializer`, `DataContractSerializer`, `JavaScriptSerializer`, JSON.NET or protobuf-net really care about `SerializableAttribute`.

However, *actually*, it is ***not*** a standard attribute, but has special handling by the compiler:

* most attributes are technically `.custom instance` values (in IL terms)
* however, `SerializableAttribute` actually maps to a CLI `.class` flag, `serializable`

This doesn't change the *meaning*, but : as a novelty fact, `SerializableAttribute` is not actually implemented as an *attribute*.
From [the documentation](http://msdn.microsoft.com/en-us/library/system.serializableattribute.aspx):

> 
> Indicates that a class can be serialized
> 
> 
> 

See the documentation for an example.