protected void AcceptPageName_Click(object sender, EventArgs e)
    {
        Util util = new Util();
        Hashtable State = (Hashtable)HttpRuntime.Cache[Session.SessionID];
        if (util.CheckSessionTimeout(State, Response, "Default.aspx")) return;

        try
        {
            ClearMessages();
            if (SavedCanvasHtml.Text.Length > 0)
                SavePage();
            string next_page = PageName.Text.Trim().Replace(" ", "_");
            PageName.Text = "";

            if (!CheckPageName(CurrentApp.SelectedValue, next_page))
            {
                return;
            }
            XmlUtil x_util = new XmlUtil();

            x_util.RenameAppPage(State,  State["SelectedAppPage"].ToString(), next_page);
            if (x_util.IsCurrentPageNameUsed(State))
            {
                x_util.ReplacePageNameUsedInSubmits(State, State["SelectedAppPage"].ToString(),next_page);
                Message.Text = "The new page name was changed for all actions that refer to it in your app.";
            }
            AppPages.SelectedValue = next_page;
            State["SelectedAppPage"] = next_page;
            PageName.Text = State["SelectedAppPage"].ToString();

            State["DoSavePage"] = true;
            InitAppPages();

            PagePanel.Style.Value = PagePanelStyle;
            ShowPage(next_page);
        }
        catch (Exception ex)
        {
             util.LogError(State, ex);
            Message.Text = "Internal Error: " + ex.Message + ": " + ex.StackTrace;
        }
    }