I don't know if its all the Hydrocodone in this cough medicine the doctor has me on (trying to recover from pneumonia) or what, maybe I'm just a little slow tonight, I'm not sure. In this ASP.Net application I'm working on I'm doing something I know Ive done a thousand times in VB.Net, but for some reason it wont work in C#.
I have made my own tab control using the
Menu,
MultiView and
View controls, and am wanting a certain menu to be selected when the page loads, so I have this:
CODE
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
Menu1.Items[0].Selected == true;
}
}
And it gives me this error message:
QUOTE
Only assignment, call, increment, decrement, and new object expressions can be used as a statement
So I thought to myself "Self, maybe you're really just loosing it and you cant actually do this", so before I wrote it off as being stupid on my part I tried it in an ASP.Net app using VB.Net, and viola, worked like a charm. Anyone know why it wont work in C#?