Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 519713
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:04:10+00:00 2026-05-13T08:04:10+00:00

See ,I have drop down control and i have keep the LIST as datasource.

  • 0

See ,I have drop down control and i have keep the LIST as datasource. But if list is null Then it throw null exception. So what is the standard way to handle this situation?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T08:04:10+00:00Added an answer on May 13, 2026 at 8:04 am

    Bind the list to the dropdown after checking whether the list is null or not.

    if (list != null) {
       dd.DataSource = list;
    }
    else {
       dd.DataSource = new List<ObjType>();
    }
    

    Note: ObjType is the type of list items that you are using in the dropdown, for example string, if the list that you are using is a list of strings.

    Thanks

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Unsure of the best way to bind a a drop-down list Content Control to
Is there a way to see users that have certain security role assigned? I'm
So I'm using Telerik's drop down list for a number of form inputs and
I have a web form that I am attempting to implement dynamic drop down
I have an ASP.NET DropDownList control that renders into a dropdown list (select HTML
If I have a public property for the designer of type Control I see
I am developing an asp web page in which I have a drop down
I have see code like this Dim s as something = new something Dim
i see they have a version of resharper for vs 2010 http://www.jetbrains.net/confluence/display/ReSharper/ReSharper+5.0+Nightly+Builds can i
Sometimes I see and have used the following variation for a fast divide in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.