Click here to Skip to main content
15,357,358 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
once i select the dropdown list from my design page, say 15 qs, now i want to go to next page based on the text i selected in the dropdownlist.
i have three items, agree, neutral and diagree
so now from the 15qs if i choose some qs as agreee and some neutral i want the user go on the next page remembering the text chosen and if i choose neutral and disagree it should go on some otherpage with the text in the list being remembered
i want help plz, in c# using sql

OK so I'm developing a project named as personality predictions system where i will be taking a survey which is a 15 questions. people can give their views i have mainly 3 items in my dropdownlist agree neutral disagree so on the basis of a person perspective he's going to select agree disagree or neutral and on on that basis the form should go to the next.
my knowledge is not very intense so that's why I'm not going to go into an intense system but I'll be making a system where a person if he selects agree on some questions and neutral on some questions he'll be directed to result page and then if he agrees neutral on one side and on some questions and disagree on some questions he'll be forwarded or directed to the result one page so there I am planning to make three different pages so I was planning to take machine learning into consideration but I did not get quite information and I have less time my submission is near so I was planning to go for if statements but I do not know how do I take dropdownlist values into if statements.

What I have tried:

i am tring but i need help, plz,plz, i tried selecteditem.dropdownlist.selecteditem.text, but idk how to put if conditions
Updated 15-May-22 5:05am
OriginalGriff 15-May-22 7:06am
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind - we only get exactly what you type to work with - we get no other context for your project.
Imagine this: you go for a drive in the country, but you have a problem with the car. You call the garage, say "it broke" and turn off your phone. How long will you be waiting before the garage arrives with the right bits and tools to fix the car given they don't know what make or model it is, who you are, what happened when it all went wrong, or even where you are?

That's what you've done here. So stop typing as little as possible and try explaining things to people who have no way to access your project!
For example, what the heck is "15 qs"? I have no idea ...

Use the "Improve question" widget to edit your question and provide better information.
Member 15198389 15-May-22 7:33am
sorry, i didnt know how this works, i have updated hope you can help me plz

1 solution

I do not know how do I take dropdownlist values into if statements.

That's simple: handle the ComboBox.myComboBox_SelectedIndexChanged event - I'd suggest using a switch instead of if ... else if ... else as it's a bit clearer when reading:
private void myComboBox_SelectedIndexChanged(object sender, EventArgs e)
    string selected = myComboBox.SelectedItem as string;
        default:    throw new ApplicationException($"Unknown dropdown option \"{selected}\"");
        case "Agree":
            // Do something
        case "Disagree":
            // Do something
        case "Neutral":
            // Do something
Member 15198389 15-May-22 12:54pm
where do i add combo box? can you please help me through anydesk or some other place..plz, i dont have combox in my toolbox

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900