protected void SaveButton_Click(object sender, EventArgs e)
        {
            // Get the plugin
            Plugin plugin = GetCurrentPlugin();

            if (plugin.HasPluginFile)
            {
                int oldId = plugin.PluginId.GetValueOrDefault();

                //set the plugin values
                plugin.PluginFile.Disabled = (!PluginActiveCheckbox.Checked);

                //set the plugins context values by iterating through data repeater values
                for (int i = 0; i < ContextsRepeater.Items.Count; i++)
                {
                    PluginContextDropDownList contextNames = (PluginContextDropDownList)ContextsRepeater.Items[i].FindControl("ContextNamesDropDownList");

                    IPluginContext context = PluginManager.GetContext(plugin, contextNames.ContextType);

                    if (context.Name != (string)contextNames.SelectedValue)
                    {
                        //selected context has changed
                        PluginManager.AddContextTypeInSection(plugin, contextNames.ContextType, (string)contextNames.SelectedValue);
                    }
                }

                //register and update the plugin
                int pluginId = ContextInfo.PluginManager.RegisterPlugin(plugin);

                if (oldId < 0)
                {
                    if (oldId != pluginId)
                    {
                        Session["FeedbackLabel"] = "registered";
                        //reload the page using the new registered plugin id
                        ReloadPlugin(pluginId);
                    }
                    else
                    {
                        FeedbackPlaceholder.Visible = true;
                        SaveFeedbackLabel.SetErrorMessage("Not Successful", "The preview plug-in was not registered");
                    }
                }
                else
                {
                    //update active status text
                    PluginActiveCheckbox.Text = (PluginActiveCheckbox.Checked ? "Yes" : "No");

                    FeedbackPlaceholder.Visible = true;
                    SaveFeedbackLabel.SetSuccessMessage("Plug-in Saved", "The plug-in was successfully updated");
                }
            }
            else
            {
                FeedbackPlaceholder.Visible = true;
                SaveFeedbackLabel.SetErrorMessage("Not Successful", "Preview plug-ins cannot be registered with invalid plugin files");
            }
        }