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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T06:18:29+00:00 2026-06-03T06:18:29+00:00

Hi ive got a drop down list where a qty of items can be

  • 0

Hi ive got a drop down list where a qty of items can be selected. 1-8.
For each item as an example if they buy one they get 25% off. if they buy 2 they get 30% 3 35%, (so it goes up 5% each time they purchase an item.

What would be an easier way to do this? mine seems quite tedious. Can you provide an exaple code please.

This is what i have but i would have to do many if statements.

protected void Page_Load(object sender, EventArgs e)
{
    if (DropDownList1.SelectedValue == "1")
    {
        int test = Convert.ToInt32(DropDownList1.SelectedValue);
        TextBox1.Text = Convert.ToString(test * (199 * (1 - 0.25)));
    }
    else if (DropDownList1.SelectedValue == "2")
    {
        int test = Convert.ToInt32(DropDownList1.SelectedValue);
        TextBox1.Text = Convert.ToString(test * (199 * (1 - 0.30)));
    }
    else if (DropDownList1.SelectedValue == "3")
    {
        int test = Convert.ToInt32(DropDownList1.SelectedValue);
        TextBox1.Text = Convert.ToString(test * (199 * (1 - 0.35)));
    }
}
  • 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-03T06:18:30+00:00Added an answer on June 3, 2026 at 6:18 am

    You should work on Selected Index. Because it gives a number.

    Multiply that number with 0.05 (0.35 -0.30 = 0.05, 0.30-0.25 = 0.05) and add in 0.25

    Let’s say Selected Index is 0 then (0 * 0.05) + 0.25 = 0.25

    If its 1 then (1 * 0.05) + 0.25 = 0.30

    and so on….

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

Sidebar

Related Questions

Ok so I've got my Drop down list databound to an sql data source,
I'm trying to re-enable the selected and disabled option from the drop-down list once
I've got a nice drop down list working which is getting populated from a
Hello I've got a loop that adds some drop down items to a Tool
I've got some lists inside lists to make some fancy drop-down menus. e.g <ul>
I have a dynamic drop down box which calls another PHP page. I've got
I've got one Posgresql database (I'm the owner) and I'd like to drop it
I've got a number of drop down lists, which allow the user to select
I've got a page which will have about ten drop down lists which are
So ive got a fully working page to display a dropdown list of all

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.