Click here to Skip to main content
15,884,176 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I was tried the above problem, I was done binding data to DropdownList. there not a problem, I wrote under SelectedIndexechanged event of DropDownList, When selecting the item in DropdownList , based on that display the data in different controls.
The problem is again we can select the same Item in DropDownList doen't go to the postback to server, we can select the another item, that will fire and also we select next the previous item is fire, The main problem is when we select the same item again and again doen't fire.I want fire the same item again and again of DropDownList.


for example: I can bind the Country names to dropdownList. I wrote code under dropdownList event. If we can select the India occurs the postback then related states coming. But here problem is again we can select same name like India. It doen't fire the event.
Posted
Updated 19-Jul-12 19:56pm
v2
Comments
pradiprenushe 20-Jul-12 1:10am    
SelectedIndexechanged Name itself suggesting too much that this will called after change. By the way why you are requiring this behavior?
Vani Kulkarni 20-Jul-12 1:15am    
Agreed with Pradip. PLease let us know why do you need this behaviour?
Sandeep Mewara 20-Jul-12 1:37am    
For FUN? :P
CH Guravaiah 20-Jul-12 1:49am    
Oh,It not fun man. Why am asking is we wrote the code selectedIndexeChanged Event , When we select same Item or another item going to postback to server. My intension is What is reason, is there any reason for that event.
Sebastian T Xavier 20-Jul-12 1:10am    
Your question is not clear.. try to add some code snippet , that will explain in a better way..

Um, that's stupid. Why would you want an event to fire when your input has not changed ? It's called SELECTEDINDEXCHANGED, but you want it to fire when it's not changed ? It's working as advertised, and you're not going to be able to change it, because I don't think there's a browser level event for 'I dropped the drop down but didn't change the value'
 
Share this answer
 
Comments
Ankur\m/ 20-Jul-12 2:01am    
Exactly, the requirement is weird.
I don't think there's a browser level event for 'I dropped the drop down but didn't change the value'
Well it can be done using jQuery - http://stackoverflow.com/questions/898463/fire-event-each-time-a-dropdownlist-item-is-selected-with-jquery
Christian Graus 20-Jul-12 2:02am    
Really ? Wow.
CH Guravaiah 20-Jul-12 2:19am    
Really i don't know Jquery. can send the link of javascript.
Christian Graus 20-Jul-12 2:23am    
You're not a web programmer in 2012 if you don't know jquery. You're also not a programmer if your work consists of asking people for links and copying and pasting. According to the code linked to, it's the blur event that fires when the control loses focus, so you could handle that with pure javascript. I'm not giving you the code though, if you can't take the name of the event and find documentation on the web, then you're not interested in being a programmer, or in my help.
CH Guravaiah 20-Jul-12 3:13am    
I am a learner not a programmer.can u help me
Why am asking is we wrote the code selectedIndexeChanged Event , When we select same Item or another item going to postback to server. My intension is What is reason, is there any reason for that event.
When we select same item, there will be no postback, as a matter of fact there is NO NEED of postback. Why would anything change at all if the same item is selected? Since there is no need to have anything different, nothing happens and thus it is designed as so.
 
Share this answer
 
Comments
CH Guravaiah 20-Jul-12 2:16am    
reply sir,

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900