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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:52:25+00:00 2026-05-22T21:52:25+00:00

I have a aspx page and inside I have called a .ascx page which

  • 0

I have a aspx page and inside I have called a .ascx page which is the shopping cart , on the aspx page I have a lot of links to the books and we can add the books to the shopping cart. On clicking the add button i store the bookid,name,price in a cookie and on the ascx page i get the copy and paste the value in the shopping cart using session variable everything is working fine..The code is something like this..on clicking the add btn i call this javascript function

       function addCookies(typeShopping,id,name,price) {

       document.cookie = typeShopping + "=" + id + "," + name + "," + price;
       }

But after this I have to do post back so the ascx page loads and adds this info to the shopping cart. so on the btn which call this function is like this..

      <a onclick="addCookies('ShoppingCart',1, 'A summary of the Creed....' ,25);"href=".../ShowBooks.aspx?CategoryName=Qur'an&Mushaf&CatID=1" </a>

but this as you see cause the page to post back and although the item adds to the shopping cart I move to the top, how can I do that I just click and the item add and the page don’t post back and I stay on the same book.

  • 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-22T21:52:26+00:00Added an answer on May 22, 2026 at 9:52 pm

    You need to return false; from the onclick handler to prevent the browser from following the default action.

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

Sidebar

Related Questions

I have an ASPX page (On server A) which is invoked using NTLM credentials.
I have one aspx page with some controls. Also i have one DIV which
I have Default.aspx page, which inherits from BasePage.cs, which inherits from System.Web.UI.Page. BasePage is
I have an aspx page with 5 listboxes. Each listbox can filter the other
I have the following in an aspx page inside a body tag: <form id=Form1
there's a CMS system and there's aspx page without backend file. I can add
Hi I have a page called compare.aspx with a magnifier image, now when i
I have a TextBox inside my .Aspx page: <ajax:UpdatePanel ID=UpdatePanel2 runat=server> <ContentTemplate> <asp:TextBox ID=txtCity
In my web app, I have an aspx page which contains an html table
I have an aspx and inside it an ascx. From a short testing I

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.