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

  • Home
  • SEARCH
  • 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 8248203
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T23:06:52+00:00 2026-06-07T23:06:52+00:00

I have a dropdown list that pulls data from template table. I have an

  • 0

I have a dropdown list that pulls data from template table. I have an Add button to insert new template. Add button will brings up jQuery popup to insert new values. There will be a save button to save the new data. On_Save_Click I enter the new data and close the popup.

Here is the proplem:
When I refresh the page, the page entering the values again. So, I get duplicate entries!

Question:
How can I avoid this issue? I check out Satckoverflow and Google, both they suggest to redirect to another page. I don’t want to redirect the user to another page. How can I use the same form to avoid this issue? Please help.

  • 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-06-07T23:06:53+00:00Added an answer on June 7, 2026 at 11:06 pm

    You can use viewstate or session to indicate if data already inserted (button pressed).

    Something like this:

    private void OnbuttonAdd_click()
    {
       if(ViewState["DataInserted"] != "1")
       {
          ...
          // Add new entry...
          ...
          if(data inserted successfully)
          {
             ViewState["DataInserted"] = "1";
          }
       }
    }
    

    Edit:

    public bool DataInserted
    {
        get
        {
            if (HttpContext.Current.Session["DataInserted"] == null)
            {
                HttpContext.Current.Session["DataInserted"] = false;
            }
            bool? dataInserted = HttpContext.Current.Session["DataInserted"] as bool?;
    
            return dataInserted.Value;
        }
        set
        {
            HttpContext.Current.Session["DataInserted"] = value;
        }
    }
    
    ...
    
    private void OnbuttonAdd_click()
    {
       if(!DataInserted)
       {
          ...
          // Add new entry...
          ...
          if(data inserted successfully)
          {
             DataInserted = true;
          }
       }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a dropdown list that holds all the columns name from the table.
I have a table that contains multiple dropdown menus for a list of profile
I have a php page that pulls data from a mysql database based on
We need to store a list of data we pull from another table that
I have a webpage written in HTML. I have a dropdown list that is
I have a php page with a dropdown list that is populated by a
I have a dropdown list with a piece of code that is run when
I have a webpage built with a dropdown that has a list of books.
I have a drop down list that is populated with data in the code
I have a dropdown list that reloads the page when its selected value is

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.