Click here to Skip to main content
15,886,258 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have created a page which has repeater, updatepanel, text box, buttons.


When I click on repeater, the itemcommand event is fired, that is okay.

When I click on button, the onclick event is fired, that is also fine.


But now if I click on any other button or repeater item command or anything, only onclick is fired and form submits again.

I don't know what is wrong but the onclick event seems to fire for all the controls.


Can anyone help out with the solution?


Detailed problem:


Repeater is on the top with the user list. downwards is a textbox with a button to save some note for that particular user.

Now when i click on repeater itemcommand fires and the textbox appears with the previous info saved (using updatepanel). I re-edited the textbox and saved using button onclick.


Now I want to navigate to 2nd user using repeater itemcommand. I clicked on user's name, but the event fired was button onclick used for saving the form but not the itemcommand.



I tried to add more button and test it but after the onclick event is fired, any other control is not firing their event but rather they are firing onclick on the save button only
Posted
Updated 1-Apr-15 2:58am
v2
Comments
ZurdoDev 1-Apr-15 8:51am    
Not sure what you mean. Buttons will post the form back if they are asp.net buttons.
Mr_cool 1-Apr-15 8:56am    
repeater is on the top with the user list. downwards is a textbox with a button to save some note for that particular user.

Now when i click on repeater itemcommand fires and the textbox appears with the previous info saved (using updatepanel). I re-edited the textbox and saved using button onclick.


Now I want to navigate to 2nd user using repeater itemcommand. I clicked on user's name, but the event fired was button onclick used for saving the form but not the itemcommand.



I tried to add more button and test it but after the onclick event is fired, any other control is not firing their event but rather they are firing onclick on the save button only
ZurdoDev 1-Apr-15 9:02am    
You're saying other controls are firing the event for a single button? Then you must have something wired up wrong. I suggest clicking on improve question and adding the relevant code.
Mr_cool 1-Apr-15 9:06am    
yes other controls are firing button onclick event.

Before I click on button, the other controls work well but after the form submission, all of them fire only onclick event of the save button.
ramyajaya 1-Apr-15 17:05pm    
Check if you have browser based errors while you run.

For example: if u have missed any close tag or any braces on the function this may result in some abnormal behaviour. Check in browser error console

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