Development Desk

Just another WordPress.com site

OnClick Event for Text Box in ASP.NET with C#

these 2 statement realy works no need to write in textbox field just write these two statements

1st one is code behind in PageLoad

TextBox1.Attributes[“onclick”] = “clearTextBox(this.id)”;

and 2nd is in aspx in header

function clearTextBox(textBoxID)
{
document.getElementById(textBoxID).value = “”;
}

thank you

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: