Hello everyone, I'm totally new to C# .NET and i was trying to set the html <option value="condition1"> attribute to "selected" based on the value match the if statement condition that i wrote: Example Code: <option value="VIC" <%# if(AdorRec.FieldValue("state", Container) == 'VIC') { Console.WriteLine('selected'); } %>>Victoria</option> Code (markup): and when i run the script it doesn't work. Could someone please give me a bit of advices? Thank you
If you are using asp.net using c# then you can set the condition using dropdownlist why are you using <option> of html if you are using c# then bind it from table and you can set the query in the coding of c# page.