Thursday, October 1, 2009

JavaScript in C#

Page.ClientScript.RegisterStartupScript(GetType(), "hideWatermark", "<script type="\">function hideWatermark(element){ if (element.value == 'Fill to change display name') { element.value = ''; } element.style.color = 'black'; }</script>");

control.Attributes.Add("onfocus", "javascript:hideWatermark(this)");

No comments: