Thursday, March 11, 2010

HOW TO Instantiate Controls Imperatively in Ajax

.aspx page


<head> 
     <title>Simple Watermark</title> 
      
 
     <script type="text/javascript"> 
  
        Sys.require(Sys.components.watermark, function() { 
 
           Sys.create.watermark("#input1", "Enter something..."); 

        }); 
      
     </script> 
 </head> 
 <body> 
  
     <input id="input1" /> 
  
</body> 
</html> 
the Sys.require() method is used to load all of the scripts required by the Watermark control