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 just long-hand for `[Serializable]`. It tags the class as one that can be 'converted' to and from other formats. 

Common examples include 'Serialization' of a class 'to' a JSON or XML data structure, and also the equivalent conversion 'from' such structures.

Consider a class

```
[Serializable]
class MyClass
{
    public string Mem1 {get; set;}
    public string Mem2 {get; set;}
}

...
MyClass mc = new MyClass;
mc.Mem1 = "Hello";
mc.Mem2 = "World";

```

When serialised to a JSON structure, we get:

```
"{'Mem1':'Hello','Mem2':'World'}"

```

And given the two-way nature of the process, if we recieved information of this format (e.g. back from some web service), then we could happily Serialize it back into an instance of this class.

Building on the JSON example, we find a series of classes in the namespace `System.Web.Script.Serialization` that can help us with this. In particular, the `JavaScriptSerializer` class helps us with the provision of `Serialize()` and `Deserialize` methods.
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.