i want to say this rule by javascript in asp.net page:
for any controls in page if control.text=" " then set control.text="" (for page textbox controls only)
how can i implement this in javascript language in asp.net form?

>how can i implement this in javascript language in asp.net form?

In asp.net web form add <script> tag,

....
  <head runat="server">
       <script type="text/javascript">
            // put javascript code here...
       </script>
  </head>
 ....

thnx but i know how to write javascript language!!!
i dont know how write this rule in javascript:
(for any controls in page if control.text="&nbsp;" then set control.text="" (for page textbox controls only))

Take a look,

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default3.aspx.cs" Inherits="Default3" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Sample</title>
    <script type="text/javascript">
      function doClear(){
        var input=document.getElementsByTagName("input");
        for(i=0;i<input.length;i++){
           if(input[i].type=="text")
             input[i].value="";
        } 
      }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox><asp:TextBox ID="TextBox2"
            runat="server"></asp:TextBox>
        <asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
        <button type="button" onclick="doClear()">Clear</button>
    </div>
    </form>
</body>
</html>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.