Newbie question
-
I drag a dropdownlist to the ASP.NET page. How do I catch event when the control`s selected index change? I tried the selectedindexChange event, but it didn`t work. Where did I do wrong. I just started learning this. So don`t go hard on me.:)
Work hard and a bit of luck is the key to success.
You don`t need to be genius, to be rich.
-
I drag a dropdownlist to the ASP.NET page. How do I catch event when the control`s selected index change? I tried the selectedindexChange event, but it didn`t work. Where did I do wrong. I just started learning this. So don`t go hard on me.:)
Work hard and a bit of luck is the key to success.
You don`t need to be genius, to be rich.
Hi there, I just started learning this. So don`t go hard on me Surely, no body will go hard on you. ;) If you want to catch up the event raised by the control when the users select an item, you basically need to create an event handler for the SelectedIndexChanged event of the DropDownList. However, this event does not cause the page immediately to be submitted to the server. If you want that to happen, you also need to set the AutoPostBack property to true. For more information on using this control, you can check out this link in MSDN: DropDownList Web Server Control[^] Btw, your name sounds like the name of the famous football striker of Indonesia : Kurniawan Yulianto (sorry if I type wrongly). :-D
-
Hi there, I just started learning this. So don`t go hard on me Surely, no body will go hard on you. ;) If you want to catch up the event raised by the control when the users select an item, you basically need to create an event handler for the SelectedIndexChanged event of the DropDownList. However, this event does not cause the page immediately to be submitted to the server. If you want that to happen, you also need to set the AutoPostBack property to true. For more information on using this control, you can check out this link in MSDN: DropDownList Web Server Control[^] Btw, your name sounds like the name of the famous football striker of Indonesia : Kurniawan Yulianto (sorry if I type wrongly). :-D
Thanks, I`ll try that. minhpc_bk wrote: Btw, your name sounds like the name of the famous football striker of Indonesia : Kurniawan Yulianto (sorry if I type wrongly). You`re right. But it`s his last name. It`s Kurniawan Dwi Yulianto, if I`m not mistaken. :)
Work hard and a bit of luck is the key to success.
You don`t need to be genius, to be rich.
-
I drag a dropdownlist to the ASP.NET page. How do I catch event when the control`s selected index change? I tried the selectedindexChange event, but it didn`t work. Where did I do wrong. I just started learning this. So don`t go hard on me.:)
Work hard and a bit of luck is the key to success.
You don`t need to be genius, to be rich.
Hmmm... sounds like your Event Wiring is not set up right. Look at the InitializeComponent() method (you'll need to toggle the Web Form generated code region). It should have something that looks like this in it (if you are using C#)
this.DropDownList1.SelectedIndexChanged += new System.EventHandler(this.DropDownList1_SelectedIndexChanged);
if you are using VB, I believe there should be a "Handles DropDownList1.SelectedIndexChanged" on the end of the selectedIndexChange method. If it doesn't, then try double clicking on the control from your web form again and see if the delegate or handler shows up. If you have a delegate (C#) or a handler (VB) and it still doesn't work, you might check your IE settings to verify that scripting is enabled. Hope that helps. Torin Blair
'In the immortal words of Socrates - "I drank what?".'