Do you mean that you literally want to stop them from entering text href="into the TextBox or want to ban URLs? In any case, the RegexValidator is one solution:
, , OOTB-regex (.. " " ). - . :
<asp:TextBox runat="server" id="myTextBox" />
<asp:CustomValidator runat="server" OnServerValidate="ValidateNoUrls" ControlToValidate="myTextBox" ErrorMessage="URLs not allowed" />
Codebehind:
protected void ValidateNoUrls(object sender, ServerValidateEventArgs e)
{
e.IsValid = !Regex.IsMatch(e.Value, @"(ht|f)tp(s?)\:\/\/[0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*(:(0-9)*)*(\/?)([a-zA-Z0-9\-\.\?\,\'\/\\\+&%\$#_]*)?");
}