Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to determine usercontrol selected child
    primarykey
    data
    text
    <p>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. </p> <p>How do I determine what is selected and if it's a child of the control? </p> <p>Markup:</p> <pre><code> &lt;%@ Register Assembly="MultiDropDown" Namespace="MultiDropDownLib" TagPrefix="MultiDropDownLib" %&gt; &lt;asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent"&gt; &lt;/asp:Content&gt; &lt;asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent"&gt; &lt;table style="width: 328px"&gt; &lt;tr&gt; &lt;td&gt; ProductClass &lt;/td&gt; &lt;td&gt; &lt;MultiDropDownLib:MultiDropDown ID="MultiDropDown1" runat="server" TextBoxClass="textboxDD" PostOnBlur="true" /&gt; &lt;/td&gt; ... </code></pre> <p>And in the control:</p> <pre><code>if (PostOnBlur) { txtItemList.Attributes.Add("onblur", string.Format("PostBack();", this.ClientID)); } </code></pre> <p>In the PostBack I want to determine what has focus and if it's part of the control. The original control came from: <a href="http://www.codeproject.com/Articles/219977/MultiDropDown-A-multiple-selection-Dropdown-contro/%20%22MultiDropDown" rel="nofollow">http://www.codeproject.com/Articles/219977/MultiDropDown-A-multiple-selection-Dropdown-contro</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload