Question

I have a combobox with a condition. I would like to bind with the condition, but when I run it, I get the error End of statement expected.

However, when I comment out these line it work perfect.

<li>
    <select name="account_type">     
        <option value="I" <% If Request.Form("account_type") = "I" Then Response.Write("SELECTED") End If %> ">Individual</option>
        <option value="C" <% If Request.Form("account_type") = "C" Then Response.Write("SELECTED")  End IF %>>Corporate</option> 
   </select>
</li>

What I am doing wrong with this? I am using VB.Net Inline coding.

Was it helpful?

Solution

'End If' is only used for multi-line If blocks. If the action is on the same line as the condition then you don't use 'End If'. Also, you ought to count your double quotes because they don;t seem to match.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top