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 8046665
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T05:51:43+00:00 2026-06-05T05:51:43+00:00

In my ASP.Net C# project I have a requirement to display a dropdown containing

  • 0

In my ASP.Net C# project I have a requirement to display a dropdown containing both people’s names and office names.

When the user makes a selection, the event is handled in JavaScript and used to filter the results of a grid. So if the user selects a person’s name from the dropdown then the grid displays only the results for that person. If the user selects an office then the grid should show the results for all the people in that office.

The filtering is handled in JavaScript on the OnClientDropDownClosed event of the dropdown.The grid and dropdown are Telerik controls not standard ones BTW.

My question is – what is the best way to determine what type of item the user has selected.
The Value for the dropdown item is either the person’s name or the office identifier.

I’m thinking I could simply add a prefix to the Value and do a substring test for it but that seems a little hacky…

is there a better way to achieve what I want?

  • 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-06-05T05:51:45+00:00Added an answer on June 5, 2026 at 5:51 am

    As there is a chance that office name and person name can be same, so we can’t do a cross check on client side.

    So my suggestion is to multiple office values with -1, so that office Ids are in negative, when a user selects a value, simply check if value is below 0 than wow its an office otherwise its a person 🙂

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

Sidebar

Related Questions

I am using ASP.NET and C# in my project. I have a requirement where
I'm using ASP.NET MVC in a project and I have a requirement like this..
I am using Asp.net/C# in my project , i have a requirement where in
In my ASP.NET MVC project I have a requirement to return certain pages in
i have one asp.net project. In this i used session for logged user. If
I have requirement of creating MS Project object in asp.net c# and exporting image
In our ASP.NET MVC project we have a Strings.resx file and the accompanying autogenerated
In an ASP.NET MVC3 project I have a structure like this: Core.csproj -> 3rdparty1.dll
I have an ASP.NET project which is a front-end to a database. In addition
I have an ASP.Net project using AJAX that I am putting on a server

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.