Click here to Skip to main content
15,906,329 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using asp:button control in my project, and I wrote onclick event for that button, in that just i wants to copy a text from one text box in to another, but when i click first time its not firing, if i click second time its working.

i placed breaking point, when there is no content in the both text box means the the event is firing in the first click. but if there is any content in the source text box automatically its not working in the first click, only works in the second click.

Even though i made cause validation=false, and EnableViewState=false not working properly,
is i made any mistakes

please tell any one for my urgency

Expecting your kind reply.
thanks
Posted
Comments
PopeDarren 9-Apr-12 10:02am    
I've had this problem while I was dynamically loading objects, but you might not have that problem. Can you post code, please?
Ankur\m/ 9-Apr-12 10:10am    
Can you try removing the button from the web page and add it again. See if that works.

1 solution

i placed breaking point, when there is no content in the both text box means the the event is firing in the first click. but if there is any content in the source text box automatically its not working in the first click, only works in the second click.

This makes me think of a possibility. Check if your textbox has AutoPostBack property set to true.
If it is, set it to false.

What happens is - if the AutoPostBack for a textbox is true, you enter some text in it and click the button, the textbox's text change will fire a postback and your button click won't be called. Instead try tabbing out and then click button, it will be called very first time.

Let me know if this helps!
 
Share this answer
 

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