Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. how to change Textbox text when the dropdownlist changing

how to change Textbox text when the dropdownlist changing

Scheduled Pinned Locked Moved Visual Basic
csharpasp-nettutorial
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    maxiachun
    wrote on last edited by
    #1

    i want to implement an ASP.net web apllication, when i change the dropdown list i want to textbox text change by itsself i have a event on the dropdown box which is selectedindexchanged code is Select Case Me.DropDownList1.SelectedItem.Text.ToUpper Case "TODAY" Me.TextBox1.Text = Now.Date & " 06:00:00 AM" Me.TextBox2.Text = Now.Date.AddDays(1) & " 05:59:59 AM" Case "YESTERDAY" Me.TextBox1.Text = Now.Date.AddDays(2) & " 05:59:59 AM" Me.TextBox2.Text = Now.Date & " 06:00:00 AM" End Select but it is not working even this event is not fired I am Entry level person

    C J 2 Replies Last reply
    0
    • M maxiachun

      i want to implement an ASP.net web apllication, when i change the dropdown list i want to textbox text change by itsself i have a event on the dropdown box which is selectedindexchanged code is Select Case Me.DropDownList1.SelectedItem.Text.ToUpper Case "TODAY" Me.TextBox1.Text = Now.Date & " 06:00:00 AM" Me.TextBox2.Text = Now.Date.AddDays(1) & " 05:59:59 AM" Case "YESTERDAY" Me.TextBox1.Text = Now.Date.AddDays(2) & " 05:59:59 AM" Me.TextBox2.Text = Now.Date & " 06:00:00 AM" End Select but it is not working even this event is not fired I am Entry level person

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      Your TextBox text MUST be changing, it must be getting set again somewhere. Given that the prerender is the only event that fires after this, is there any code in there to set the text ? That's assuming that you've stepped through and these case statements are working ( i.e. one is being caught every time ). Christian Graus - Microsoft MVP - C++

      1 Reply Last reply
      0
      • M maxiachun

        i want to implement an ASP.net web apllication, when i change the dropdown list i want to textbox text change by itsself i have a event on the dropdown box which is selectedindexchanged code is Select Case Me.DropDownList1.SelectedItem.Text.ToUpper Case "TODAY" Me.TextBox1.Text = Now.Date & " 06:00:00 AM" Me.TextBox2.Text = Now.Date.AddDays(1) & " 05:59:59 AM" Case "YESTERDAY" Me.TextBox1.Text = Now.Date.AddDays(2) & " 05:59:59 AM" Me.TextBox2.Text = Now.Date & " 06:00:00 AM" End Select but it is not working even this event is not fired I am Entry level person

        J Offline
        J Offline
        jcrussell
        wrote on last edited by
        #3

        make sure that the dropdown box has the AutoPostback Property set to true /jason -- modified at 1:33 Wednesday 23rd November, 2005 [edit] do this by going to the design view of the Form, viewing the properties of the selected the DropDown box and setting the property there [/edit]

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups