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 7702529
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T23:14:52+00:00 2026-05-31T23:14:52+00:00

I have a control if a review already exist, if it exist I want

  • 0

I have a control if a review already exist, if it exist I want to warn the visitor that if the person click OK/yes in the alert the review will be overwritten, if the person press no/cancel the review will not be updated. But it doesn’t work, in the debugging the alert line just passes by and updates without any alert.

if (ReviewExist(StoreID, UserID) != 0)
{
    ScriptManager.RegisterStartupScript(this, this.GetType(), "Message", "confirm('Are you sure?');", true);
    UpdateStoreReview(Description);
    Response.Redirect("Default");
}
else      
{
    AddStoreReview(Description);
}
  • 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-31T23:14:54+00:00Added an answer on May 31, 2026 at 11:14 pm

    It is because your Response.Redirect redirects the control to another page which will ignore your RegisterScript.

    What you need to do is, if you are trying to acheive this in the button click (update button), then in the Page_Load try

    if(!IsPostBack)    
    {
     btnUpdate.Attributes.Add("OnClick","confirm('Are you sure?');");
    }
    

    Then the above code can be changed to

    if (ReviewExist(StoreID, UserID) != 0)
    {
        UpdateStoreReview(Description);
        Response.Redirect("Default");
    }
    else      
    {
        AddStoreReview(Description);
    }
    

    Note
    I think you need to redirect to Default.aspx; but you are missing .aspx in the response.redirect.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to read UTF-8 strings from a server that I have control of,
Is there a way to Minimize an external application that I don't have control
I am using asp.net MVC. I have control like <%= Html.TextBox(username) %> I want
I have a control that, upon postback, saves form results back to the database.
I have a list view with a HyperLink control within the ItemTemplate. I want
In Linux, .DEB files have 'control' text files that are arranged as follows: Name:
I'm using TFS 2010 as a Source Control System and have the problem that
I want to create a custom control (partial view, template) and have it function
I have a textbox that will collect the ip address from the user. I
I have control over the HttpServer but not over the ApplicationServer or the Java

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.