You need to sign in to do that
Don't have an account?
rupesh ranjan
Error : expecting right curly bracket, found 'if'
expecting right curly bracket, found 'if'
<select id="MySelectMenu"> <option value="f">Demos On Demand Report</option> <option value="s">Pointmarketing Report</option> </select>
public String MySelectMenu { get; set; } public String SelectMenu { get; set; } if(MySelectMenu == 'Demos On Demand Report' ){ SelectMenu = 'DemosOnDemandReport'; } else(MySelectMenu == 'Pointmarketing Report' ){ SelectMenu = 'PointmarketingReport'; }
You cant keep if else directly inside class, these should be inside some method or constructor. so you can add these in constructor or create a method where you will be adding these and then call that method from constructor.
Thanks!
I found Some error in your code please review the suggetion given below
public unit1() {
if(MySelectMenu == 'Demos On Demand Report' ){
SelectMenu = 'DemosOnDemandReport';
}
else(MySelectMenu == 'Pointmarketing Report' ){ SelectMenu = 'PointmarketingReport';
}
}
- If else problem, you have to use nested if in your condition.
Example :-if(MySelectMenu == 'Demos On Demand Report' ){
SelectMenu = 'DemosOnDemandReport';
}
else if(MySelectMenu == 'Pointmarketing Report' ){
SelectMenu = 'PointmarketingReport';
}
else{
}
Hope this helps you!
Thanks
public string name ='manish';
public decimal marks =55;
public boolean result =true;
if(name == 'manish' ){
marks = '35';
result = 'true';
} else{
marks = 25;
result = false;
}