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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T15:22:10+00:00 2026-05-20T15:22:10+00:00

I’m trying to update certain controls according to a selection in a dropdown list.

  • 0

I’m trying to update certain controls according to a selection in a dropdown list.

For example, in the “selectedIndexChanged” event of a dropDownList, if a user selects the value “sport-car” the text box “payload” is disabled and the textbox “max speed” is enabled.

    private sub dropDownList1_SelectedIndexChanged(byval sender as object, byval e as eventargs) handles dropDownList1.SelectedIndexChanged

    If dropDownList1.selectedValue = "sport-car" then

     textBox_payLoad.enabled = false
     textBox_maxSpeed.enabled = true

    end if

end sub

When I’m doing something like this, the controls aren’t enabled/disabled, even the event (wich I’ve added a breakpoint) seems not to be raised (sometimes several time after it is raised). Also, when the instructions in the condition is executed, nothing changes.

What am I doing wrong? Maybe this is a very easy issue, but I’m a begginer in MS Visual Web Developer.

Tags:

<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="combo_atualizacao.aspx.vb" Inherits="taxasN4Web_v01.combo_atualizacao" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server">
    </asp:ScriptManagerProxy>
    <asp:UpdatePanel ID="UpdatePanel2" runat="server">
        <ContentTemplate>
            <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True">
                <asp:ListItem>sport-car</asp:ListItem>
                <asp:ListItem>pickup</asp:ListItem>
                <asp:ListItem>van</asp:ListItem>
                <asp:ListItem>bus</asp:ListItem>
                <asp:ListItem>motorcycle</asp:ListItem>
                <asp:ListItem></asp:ListItem>
            </asp:DropDownList>
            Payload
            <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
            &nbsp;Max Speed<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
        </ContentTemplate>
    </asp:UpdatePanel>
    <p>
    Payload 
    </p>
    <p>
    Max speed 
    </p>

</asp:Content>

Code-Behind (VB):

Public Class combo_atualizacao
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub

    Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles DropDownList1.SelectedIndexChanged
        If DropDownList1.SelectedValue = "sport-car" Then
            TextBox1.Enabled = False
            TextBox1.Enabled = True
        End If
    End Sub
End Class
  • 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-20T15:22:11+00:00Added an answer on May 20, 2026 at 3:22 pm

    Can you try adding the following to your update panel:

    <asp:updatepanel>
    <contenttemplate>
     ...
    </contenttemplate>
    <Triggers>
     <asp:AsyncPostBackTrigger ControlID="DropDownList1" EventName="SelectedIndexChanged" />
    </Triggers>
    </updatepanel>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to loop through a bunch of documents I have to put
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I need to clean up various Word 'smart' characters in user input, including but
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string

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.