You can do it by two ways refer any one of below and implement it by your own logic.
1) Remove the text property and ForColor Property from Textbox also add PlaceHolder with default text enter your name
<asp:TextBox ID="TextBox1" runat="server" CssClass="txtSef" PlaceHolder="enter your name"
onkeydown="return isNumeric(event.keyCode);" onpaste="return false;" onblur="WaterMark(this, event,'enter your name');"
onfocus="WaterMark(this, event,'enter your name');"></asp:TextBox>
2) You can check the text and set the color on load of page using JavaScript too.
<script type="text/javascript">
window.onload = function SetColorOnPageLoad() {
var defalutText = "enter your name";
var Textbox1 = document.getElementById("TextBox1");
if (Textbox1.value.length > 0 && Textbox1.value == defalutText) {
Textbox1.style.color = "#b1b1b1";
} else {
Textbox1.style.color = "black";
}
}
function WaterMark(txt, evt, msg) {
if (txt.value.length == 0 && evt.type == "blur") {
txt.style.color = "#b1b1b1";
txt.value = msg;
}
if (txt.value == msg && evt.type == "focus") {
txt.style.color = "black";
txt.value = "";
}
}
</script>