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

The Archive Base Latest Questions

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

I have a user control, a dropdown list, that’s comprised of many component controls.

  • 0

I have a user control, a dropdown list, that’s comprised of many component controls.
The main HtmlInputText will post back on an enter but on loss of focus it doesn’t and I need that to update other controls.
I added an onblur function, and it gets called, but I only want to postback when the element getting focus isn’t part of the user control.

How do I determine what is selected and if it’s a child of the control?

Markup:

    <%@ Register Assembly="MultiDropDown" Namespace="MultiDropDownLib" TagPrefix="MultiDropDownLib" %>
    <asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
    </asp:Content>
    <asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
        <table style="width: 328px">
            <tr>
                <td>
                    ProductClass
                </td>
                <td>
                    <MultiDropDownLib:MultiDropDown ID="MultiDropDown1" runat="server" TextBoxClass="textboxDD"
                        PostOnBlur="true" />
                </td>
   ...

And in the control:

if (PostOnBlur)
{
    txtItemList.Attributes.Add("onblur", string.Format("PostBack();", this.ClientID));
}

In the PostBack I want to determine what has focus and if it’s part of the control. The original control came from: http://www.codeproject.com/Articles/219977/MultiDropDown-A-multiple-selection-Dropdown-contro

  • 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-29T08:10:20+00:00Added an answer on May 29, 2026 at 8:10 am

    This is a way to do it with javascript and jQuery:

    <script language="javascript" type="text/javascript">
        $(document).ready(function () {
            $(":input").focus(function () {
                if (this.name.indexOf("$WebUserControl1") > -1) {
                    alert("It is child of my control.");
                }
            });
        });
    </script>
    

    Just replace $WebUserControl1 with the name of your user control. This could also be Dynamic if you want to. Basically all of the children of the usercontrol will contain the name of their parent because WebUserControls inherit from TemplateControl which implements the INamingContainer interface.

    Good luck.

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

Sidebar

Related Questions

I need a dropdown list on my page that will allow a user to
I have an ASP.NET DropDownList control that renders into a dropdown list (select HTML
I have several user controls that contain a drop down list, various validation controls,
I have a drop-down list hardcoded in an MVC View User Control page and
So say I have a dropdown control, and after the user uses the drop
I have a composite drop down calendar user control that consists of a textbox
I'm just getting started with silverlight. Basically I have a silverlight user control that
I have a user control that exposes a property of type ImageSource. I want
I have a page that contains a user control that is just a personalized
Basically, I have a drop down list and a dynamically added user control. The

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.