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

  • Home
  • SEARCH
  • 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 8621261
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T06:46:51+00:00 2026-06-12T06:46:51+00:00

I found a combobox here and now I’m facing a problem when I try

  • 0

I found a combobox here and now I’m facing a problem when I try using the jQuery with my updatepanel. The combobox works great when I first open the page until a partial postback happens. So if I was to change the DropdownList ddlTagLevel3_1, for example, then the dropdown ddlTagname1 doesn’t show the jQuery combobox anymore. Any ideas what I need to do? Here is my code with some lines ommitted for simplicity (thanks):

TagFilter.master:

<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
        <div id="div1" class="GridFilter" runat="server">
                <asp:Panel ID="Panel3" CssClass="PanelGridContents" runat="server">
            <div id="divTagFilterTable" runat="server">
                <asp:table ID="Table2" BorderWidth="0" CellPadding="4" runat="server">
                    <asp:TableRow>
                        <asp:TableCell>
                        <asp:Table ID="tblTagGridFilter" CellPadding="4" runat="server" CellSpacing="0" BackColor="White" CssClass="TagGridFilter" BorderStyle="Solid" BorderWidth="1">
                                                        <asp:TableRow ID="tr1" runat="server">
                                                            <asp:TableCell CssClass="TagGridFilter2" Wrap="false">
                                                                <asp:ImageButton runat="server" ID="ibAdd" OnClick="ibAdd_Click" ImageUrl="~/Images/add.gif" Visible="true"></asp:ImageButton>
                                                                <asp:Image runat="server" ID="ImageButton2" ImageUrl="~/Images/noImage.gif" Width="5px" Visible="true"></asp:Image>
                                                                <asp:ImageButton runat="server" ID="ibRemove" OnClick="ibRemove_Click" ImageUrl="~/Images/remove.gif" Visible="true"></asp:ImageButton>
                                                            </asp:TableCell>
                                                            <asp:TableCell BorderWidth="1" CssClass="TagGridFilter2" Wrap="false">
                                                                <asp:Button ID="btnGridSwap_1" runat="server" Text="M" OnClick="bntGridSwap_1Click" />
                                                            </asp:TableCell>
                                                            <asp:TableCell ID="tcDisplayLevel_1" ColumnSpan="3" BorderWidth="1" CssClass="TagGridFilter" Visible="false" Wrap="false">
                                                                <asp:DropDownList ID="ddlDisplay1" AutoPostBack="True" OnSelectedIndexChanged="ddlDisplay1Changed" runat="server" />
                                                            </asp:TableCell>
                                                            <asp:TableCell ID="tcTagLevel1_1" BorderWidth="1" CssClass="TagGridFilter" Wrap="false">
                                                                <asp:DropDownList ID="ddlTagLevel1_1" AutoPostBack="True" OnSelectedIndexChanged="ddlTagLevel1_1Changed" runat="server" />
                                                            </asp:TableCell>
                                                            <asp:TableCell ID="tcTagLevel2_1" BorderWidth="1" CssClass="TagGridFilter" Wrap="false">
                                                                <asp:DropDownList ID="ddlTagLevel2_1" AutoPostBack="True" OnSelectedIndexChanged="ddlTagLevel2_1Changed" runat="server" />
                                                            </asp:TableCell>
                                                            <asp:TableCell ID="tcTagLevel3_1" BorderWidth="1" CssClass="TagGridFilter" Wrap="false">
                                                                <asp:DropDownList ID="ddlTagLevel3_1" AutoPostBack="True" OnSelectedIndexChanged="ddlTagLevel3_1Changed" runat="server" />
                                                            </asp:TableCell>
                                                            <asp:TableCell BorderWidth="1" CssClass="TagGridFilter1" Wrap="false">
                                                                <asp:Label id="lblDevice1" runat="server" />
                                                            </asp:TableCell>
                                                            <asp:TableCell BorderWidth="1" CssClass="TagGridFilter" Wrap="false">
                                                                <asp:DropDownList ID="ddlTagname1" AutoPostBack="True" OnSelectedIndexChanged="ddlTagname_1Changed" runat="server" />
                                                            </asp:TableCell>
                                                            <asp:TableCell BorderWidth="1" CssClass="TagGridFilter1" Wrap="false">
                                                                <asp:Label id="lblDescription1" runat="server" />
                                                            </asp:TableCell>
                                                            <asp:TableCell BorderWidth="1" CssClass="TagGridFilter1" Wrap="false">
                                                                <asp:Label id="lblType1" runat="server" />
                                                            </asp:TableCell>
                                                            <asp:TableCell BorderWidth="1" CssClass="TagGridFilter1" Wrap="false">
                                                                <asp:Label id="lblUOM1" runat="server" />
                                                            </asp:TableCell>
                                                            <asp:TableCell ID="tcNew1" Visible="false" BorderWidth="1" CssClass="TagGridFilter" Wrap="false" HorizontalAlign="Center">
                                                                <asp:ImageButton runat="server" ID="ibNewRecord1" OnClick="ibNewRecord1_Click" ImageUrl="~/Images/new_tiny.gif" Visible="false"></asp:ImageButton>
                                                            </asp:TableCell>
                                    </asp:TableRow>
                    </asp:Table>
                    </asp:TableCell>
                                </asp:table>
                        </div>
                </asp:Panel>
        </div>
</ContentTemplate>

TagSummaryDetail.aspx.cs:

    protected new void Page_PreRender(object sender, EventArgs e)
{
    base.Page_PreRender(sender, e);

    if (GridView_Summary.SelectedIndex < 0 && GridView_Summary.Rows.Count == 0)
        ProcessSelection();

    string style = @"
        <style>
            .ui-combobox {
                position: relative;
                display: inline-block;
                background: #ffffff;
            }
            .ui-combobox-toggle {
                position: absolute;
                top: 0;
                bottom: 0;
                margin-left: -1px;
                padding: 0;
                background: #ffffff
                /* adjust styles for IE 6/7 */
                *height: 1.7em;
                *top: 0.1em;
            }
            .ui-combobox-input {
                margin: 0;
                padding: 0.2em;
                background: #ffffff;
                width: 20em;
            }
            .ui-button-icon-only .ui-button-text { background: #e6e6e6; } 
        </style>";
    this.Page.ClientScript.RegisterStartupScript(this.GetType(), "style", style);

    string script = @"
            <script>
                (function ($) {
                    $.widget(""ui.combobox"", {
                        _create: function () {
                            var input,
                        self = this,
                        select = this.element.hide(),
                        selected = select.children("":selected""),
                        value = selected.val() ? selected.text() : """",
                        wrapper = this.wrapper = $(""<span>"")
                            .addClass(""ui-combobox"")
                            .insertAfter(select);

                            input = $(""<input>"")
                        .appendTo(wrapper)
                        .val(value)
                        .addClass(""ui-state-default ui-combobox-input"")
                        .autocomplete({
                            delay: 0,
                            minLength: 0,
                            source: function (request, response) {
                                var matcher = new RegExp($.ui.autocomplete.escapeRegex(request.term), ""i"");
                                response(select.children(""option"").map(function () {
                                    var text = $(this).text();
                                    if (this.value && (!request.term || matcher.test(text)))
                                        return {
                                            label: text.replace(
                                                new RegExp(
                                                    ""(?![^&;]+;)(?!<[^<>]*)("" +
                                                    $.ui.autocomplete.escapeRegex(request.term) +
                                                    "")(?![^<>]*>)(?![^&;]+;)"", ""gi""
                                                ), ""<strong>$1</strong>""),
                                            value: text,
                                            option: this
                                        };
                                }));
                            },
                            select: function (event, ui) {
                                ui.item.option.selected = true;
                                self._trigger(""selected"", event, {
                                    item: ui.item.option
                                });
                            },
                            change: function (event, ui) {
                                if (!ui.item) {
                                    var matcher = new RegExp(""^"" + $.ui.autocomplete.escapeRegex($(this).val()) + ""$"", ""i""),
                                        valid = false;
                                    select.children(""option"").each(function () {
                                        if ($(this).text().match(matcher)) {
                                            this.selected = valid = true;
                                            return false;
                                        }
                                    });
                                    if (!valid) {
                                        // remove invalid value, as it didn't match anything
                                        $(this).val("""");
                                        select.val("""");
                                        input.data(""autocomplete"").term = """";
                                        return false;
                                    }
                                }
                            }
                        })
                        .addClass(""ui-widget ui-widget-content ui-corner-left"");

                            input.data(""autocomplete"")._renderItem = function (ul, item) {
                                return $(""<li></li>"")
                            .data(""item.autocomplete"", item)
                            .append(""<a>"" + item.label + ""</a>"")
                            .appendTo(ul);
                            };

                            $(""<a>"")
                        .attr(""tabIndex"", -1)
                        .attr(""title"", ""Show All Items"")
                        .appendTo(wrapper)
                        .button({
                            icons: {
                                primary: ""ui-icon-triangle-1-s""
                            },
                            text: false
                        })
                        .removeClass(""ui-corner-all"")
                        .addClass(""ui-corner-right ui-combobox-toggle"")
                        .click(function () {
                            // close if already visible
                            if (input.autocomplete(""widget"").is("":visible"")) {
                                input.autocomplete(""close"");
                                return;
                            }

                            // work around a bug (likely same cause as #5265)
                            $(this).blur();

                            // pass empty string as value to search for, displaying all results
                            input.autocomplete(""search"", """");
                            input.focus();
                        });
                        },

                        destroy: function () {
                            this.wrapper.remove();
                            this.element.show();
                            $.Widget.prototype.destroy.call(this);
                        }
                    });
                })(jQuery);

                $(function () {
                    $(""#" + Master.Tagname1.ClientID + @""").combobox();  //Tagname1 is ddlTagname1
                    $(""#toggle"").click(function () {
                        $(""#" + Master.Tagname1.ClientID + @""").toggle();
                    });
                });
            </script>";

    this.Page.ClientScript.RegisterStartupScript(this.GetType(), "jQuery", script);
  • 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-12T06:46:52+00:00Added an answer on June 12, 2026 at 6:46 am

    When the page is opened first, than it is a HTTP GET request.

    But any other request is HTTP POST request, so you script is not available at this request.

    You need to register script to use it in UpdatePanel before request.

    More info here:
    http://helpondesk.blogspot.cz/2008/11/how-to-register-client-script-inside.html

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

Sidebar

Related Questions

While trying to solve a two-way data binding problem in here , I found
I'm using this filtered WPF ComboBox control from Diederik Krols. I have found that
Here's the case: I want to append multiple gtk.VBox()'es to a gtk.ComboBox. Haven't found
I am facing an issue with the latest jQuery combobox. The use case is
Found this while reading the Neo4j manual, specifically here , I found the sentence:
I just found out that the jQueryUI now has it's own built-in auto-complete combo
i'm trying hard to load comboBox items from an xml file. Here is my
I've posted a similar problem here and wasn't able to successfully implement the solution
I'm having a problem binding the jQueryUI combobox value to a computed observable in
I have a simple comboBox with some Value/Text items in it. I have using

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.