Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Comparison with DropDownList SelectedValue
Message
From
27/01/2011 11:35:49
 
 
To
All
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Title:
Comparison with DropDownList SelectedValue
Miscellaneous
Thread ID:
01497545
Message ID:
01497545
Views:
95
Hi,

I want to compare the SelectedValue of a Drop Down List with a status value, but I'm getting this error:

Operator '==' cannot be applied to operands of type 'string' and 'int

My code is:

UPDATE: changed the next line to include "" marks and got it fixed, I had been using single quotations and that wasn't working
            if (this.cboStatus.SelectedValue == "11" || this.cboStatus.SelectedValue == "7")
            {
                this.lblDeathDate.Visible = true;
                this.txtDeathDate.Visible = true;
                this.btnDisplayDeathDateCalendar.Visible = true;
            }
My DropDownList definition is:
                            <mm:mmDropDownList ID="cboStatus" runat="server" BindingSource="Status" BindingSourceDisplayMember="Status"
                                BindingSourceValueMember="StatusPK" BindingValueSource="Policy" BindingValueSourceMember="StatusFK"
                                Enabled="False" AutoPostBack="true" OnTextChanged="cboStatus_TextChanged">
                            </mm:mmDropDownList>
What do I need to do to compare this?
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Next
Reply
Map
View

Click here to load this message in the networking platform