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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T18:18:27+00:00 2026-05-31T18:18:27+00:00

I have an UserControl and in it, a DropDownList. I’m using this code to

  • 0

I have an UserControl and in it, a DropDownList. I’m using this code to add a disabled separator to the list of items:

ListItem separador1 = new ListItem(" -- -- -- -- -- ", "Separador");
separador1.Attributes.Add("disabled", "true");
this.ddlPais.Items.Add(separador1);

It works OK when the user control is displayed in a Page normally, but when it is located in a JQuery UI Dialog the separators items don’t have the enabled attribute and off course they are enabled.

Important Note: I managed to solve my problem while still typing the question in. I will post it anyway in case someone experience what I think is a jquery bug.

The solution was to add the disabled attribute after opening the JQuery Dialog.

$("#" + PanelClientId).dialog( "open" );
$("#" + PanelClientId).parent().appendTo(jQuery("form:first"));    
$('option[value="Separador"]').attr('disabled','true'); //This is new in my code
  • 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-31T18:18:28+00:00Added an answer on May 31, 2026 at 6:18 pm

    I managed to fix it with a workaround. The solution was to add the disabled attribute in each pageLoad; it has to be the client side pageLoad to disable items after each async postback since I’m using UpdatePanel.

    <script type="text/javascript">
        function pageLoad(sender, args) { 
            $('option[value="Separador"]').attr('disabled','true');
        }
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have usercontrol in my page loaded using Page.Controls.Add(ctrl) Now, I have button in
So I have a UserControl with some cascading DropDownList s on it. Selecting from
I have a UserControl, containing a FormView, containing a DropDownList. The FormView is bound
I have a custom usercontrol, which is basically a dropdownlist, prepopulated with values from
I have a usercontrol which has a combobox inside it. This UserControl is the
I have a simple user control with this code: <%@ Control Language="C#" AutoEventWireup="true" CodeFile="Pager.ascx.cs"
I have a UserControl containing TextBoxes and ComboBoxes and this UserControl is contained in
I have a DropDownList inside a usercontrol, which is itself inside a usercontrol. The
I have following dropdwonlists in a UserControl; <span class=src-engine-row-title-span>ADT : </span> <asp:DropDownList runat=server ID=ddlAdultTrf></asp:DropDownList>
I have a user control I'm building (ASP.NET 3.5, using C#). This control is

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.