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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T04:09:33+00:00 2026-06-02T04:09:33+00:00

I’m using the jquery ui dialog and I’ve got it set up so that

  • 0

I’m using the jquery ui dialog and I’ve got it set up so that it has a text box and a button.
You basically type something into the text box and click the button, it pulls some values from a database and loads a radiobutton list. HTML markup looks like this:

 <div id="dialog" title="Select Address">
        <asp:UpdatePanel ID="upNewUpdatePanel" UpdateMode="Conditional" ChildrenAsTriggers="true" runat="server">
        <ContentTemplate>
            <div id="search" style="width:100%; text-align:center;">
                <asp:TextBox ID="txtFindSearch" runat="server"></asp:TextBox> 
                <asp:Button ID="btnFindSearch" runat="server" Text="Search" 
                    onclick="btnFindSearch_Click" />
                <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
            </div>
            <div id="searchresults" style="width:100%;">
                <asp:RadioButtonList ID="rbSearchResults" runat="server" AutoPostBack="True" 
                    CellSpacing="10" RepeatColumns="4" RepeatDirection="Horizontal" 
                    ToolTip="Select an address." 
                    onselectedindexchanged="rbSearchResults_SelectedIndexChanged">
                </asp:RadioButtonList>
            </div>
        </ContentTemplate>
        </asp:UpdatePanel>
        </div>

In the code behind I can get the selected value like this:

 protected void rbSearchResults_SelectedIndexChanged(object sender, EventArgs e)
        {
            Label1.Text = rbSearchResults.SelectedValue.ToString();
        }

My issue is I don’t know how to close the jquery dialog box AFTER a selection is made from the radio button list. I tried to do something like this in jquery:

  $('#MainContent_rbSearchResults input').click(function () {
       $('#dialog').hide();
   });

Even if I throw an alert in there it doesn’t display the alert. If I view page source I see the div container but I don’t see the radiobuttonlist, could it be because it is wrapped in an updatepanel?

How can I close the jquery ui dialog after I get a value (a click of the radiobuttonlist)?

Edit

I tried with this:

 protected void rbSearchResults_SelectedIndexChanged(object sender, EventArgs e)
        {
            Label1.Text = rbSearchResults.SelectedValue.ToString();
            this.txtShipToName.Text = Label1.Text;
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "closedialog", "$(function(){$('#dialog').dialog('close');});", true);
        }

And this closes the dialog however my textbox txtShipToName never gets a value. Even though if I step through the debug I see the value being assigned to it.

  • 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-02T04:09:34+00:00Added an answer on June 2, 2026 at 4:09 am

    txtShipToName is not inside the UpdatePanel, that is why it is not holding its value.

    To solve this issue you can put txtShipToName inside another UpdatePanel with UpdateMode set to Conditional and then add this to your code:

    Label1.Text = rbSearchResults.SelectedValue.ToString();
    this.txtShipToName.Text = Label1.Text;
    this.theNewUpdatePanel.Update(); //Add this line
    

    EDIT

    As ek_ny stated on his answer, it is better to set UpdateMode to always for the new UpdatePanel and then you don’t need to call Update() on it.

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

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I've got a string that has curly quotes in it. I'd like to replace
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am reading a book about Javascript and jQuery and using one of the
I have a French site that I want to parse, but am running into
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text

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.