Question
Question regarding .Net/Razor -- > code and question below ========================== create a form (the colors are Red, Green, Blue): When you submit the form, the
Question regarding .Net/Razor -- > code and question below
==========================
create a form (the colors are Red, Green, Blue):
When you submit the form, the colors are combined as follows:
Red & Red = Red
Red & Green OR Green & Red = Yellow
Red & Blue OR Blue & Red = Magenta
Green & Green = Green
Green & Blue OR Blue & Green = Cyan
Blue & Blue = Blue
---CODE----
Home
Primary Colors
$(function () {
//variable randomNumber will give Random number each time and corresponding switch will apply random CSS
protected void Submit_Click(object sender , EventArgs e)
{
if(Color1.SelectedValue == "red" && Color2.SelectedValue == "red1") { Resultant.Text = "Red"; }
if (Color1.SelectedValue == "red" && Color2.SelectedValue == "green1") { Resultant.Text = "Yellow"; }
if (Color1.SelectedValue == "green" && Color2.SelectedValue == "red1") { Resultant.Text = "Yellow"; }
if (Color1.SelectedValue == "red" && Color2.SelectedValue == "blue1") { Resultant.Text = "Magenta"; }
if (Color1.SelectedValue == "blue" && Color2.SelectedValue == "red1") { Resultant.Text = "Magenta"; }
if (Color1.Selected Value == "green" && Color2.SelectedValue == "green1") { Resultant.Text = "Green"; }
if (Color1.SelectedValue == "green" && Color2.SelectedValue == "blue1") { Resultant.Text = "Cyan"; }
if (Color1.SelectedValue == "blue" && Color2.SelectedValue == "green1") { Resultant.Text = "Cyan"; }
if (Color1.SelectedValue == "blue" && Color2.SelectedValue == "blue1") { Resultant.Text = "Blue"; }
}
});
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started