-----------------------------------------------------------

New Message on MumbaiUserGroup

-----------------------------------------------------------
From: Saritha
Message 8 in Discussion




  
    
    New Message on MumbaiUserGroup
  
  





      Textbox focus in Asp.net application

    
  
    
      Reply

          
            
                
               
                  Reply to Sender
                    Recommend
                  
                  Message 7 in Discussion
                                                
            
          
        
                    
        
            
              From: 
              Saritha
            
            
              

              Hello Amit,

You can set Focus to a textbox using JavaScript in ASP.Net.

Eg:
 language='JavaScript'>
function SetFocus()
{
    document.Form1['TextBox1'].focus();
}
window.onload = SetFocus;
</script>

If you use this code in the .aspx code. Also, you can generate this code in 
your code-behind using the following syntax:

public static void SetFocus(Control control)
{
    StringBuilder sb = new StringBuilder();
 
    sb.Append("\r\n language='JavaScript'>\r\n");
    sb.Append("\r\n"); 
    sb.Append("</script>");
 
    control.Page.RegisterClientScriptBlock("SetFocus", sb.ToString());
}

Hope this works for you. If you have any questions let me know.

Thanks,
Saritha
          
        
      
          
  

    View other groups in this category.
  

  

      




-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/mumbaiusergroup/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member 
Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you 
received this message by mistake, please click the "Remove" link below. On the 
pre-addressed e-mail message that opens, simply click "Send". Your e-mail 
address will be deleted from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to