Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 314167
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T08:10:31+00:00 2026-05-12T08:10:31+00:00

I have a simple content management system that stores pages by Pagename and Version.

  • 0

I have a simple content management system that stores pages by Pagename and Version. After clicking on Save, my code (server side) checks for the existence of Pagename/Version.

If it exists I would like to display a confirmation dialog box, which asks the user to confirm whether or not the current Pagename/Version should be replaced.

What is the easiest way to accomplish this? Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T08:10:31+00:00Added an answer on May 12, 2026 at 8:10 am

    I appreciate both previous answers and they were helpful but not exactly what I was looking for. After considering the responses and doing more research I’m posting my solution so that maybe it will help someone else.

    Button code:

     <asp:Button ID="btnSave" OnClick="btnSaveClick" runat="server" Text="Save" OnClientClick="return CheckForVersion()" />
    

    Javascript:

    <script language="javascript">
        function CheckForVersion() {
            PageMethods.CheckForVersion(aspnetForm.ctl00$ContentPlaceHolder1$ddlPageName2.value, aspnetForm.ctl00$ContentPlaceHolder1$txtContentName2.value, OnSucceeded, OnFailed);
            return false;
        }
    
        function OnSucceeded(results) {
           if(results) {
                //version exists so prompt user
                if(confirm("Version already exists. Do you want to overwrite?")) {
                    __doPostBack('ctl00$ContentPlaceHolder1$btnSave','');
                }
            }
            else
            {
                //version does not exist so save it without prompting user
                __doPostBack('ctl00$ContentPlaceHolder1$btnSave',''); 
            }
    
        }
    
        function OnFailed(error) {
            // handle pagemethod error
            alert(error.get_message());
        }
    
    </script>
    

    C# using Subsonic 2.1:

    [WebMethod]
        public static bool CheckForVersion(string pageName, string versionName)
        {
            PageContentCollection pages = new PageContentCollection().Where("pageName", pageName).Where("versionName", versionName).Load();
            if (pages.Count > 0)
                return true;
            else
                return false;            
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently working on a simple content management system. I have a div that
I've written a content management system that uses a server-side regular expression to escape
What are the options for having a simple blog, content management system that will
I'm working on a PHP content management system and, in testing, have noticed that
So I have some particular variables that mess up the content management system I'm
I have written simple code to get content from xml file to php. $xml
I have a simple Button control that contains an Image object as its content.
I am attempting to build a simple content management system using Twitter's Bootstrap for
I am developing a basic LCMS (Learning Content Management System) and I have to
I have a content management system in which a user can dynamically create an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.