Ramco Ramco

Ramco Ramco

  • 422
  • 3.4k
  • 489.5k

The name lstState.Items.Count does not exist in the current context

Aug 21 2022 3:56 PM

Hi

  Below code gives error The name lstState.Items.Count does not exist in the current context

List<string> StateCollection = new List<string>();
        if (lstState.Items.Count > 0)
        {

}

  <div class="col-lg-3 col-md-6 col-sm-12">
                                            <div class="form-group">
                                                <label>State</label>
                                                <asp:ListBox ID="lstState" runat="server" data-placeholder="Choose State" class="form-control multiselect-full-featured" multiple="multiple" SelectionMode="Multiple" data-fouc=""></asp:ListBox>
                                            </div>
                                        </div>


Answers (3)