I have a textbox and a button with an onClick event connected to it, and when the button is clicked once I want to change the text of the button and clear the textbox. How can i accomplish this?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you want to do this on a postback (a complete refresh of the page), simply put code in your button click handler to set these values. For example,
textbox.Text = string.Empty;If you want to set it on the client side (without refreshing the page), then you’d need to use client script such as JavaScript.