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

New Message on BDOTNET

-----------------------------------------------------------
From: Raman82
Message 8 in Discussion

hi,
if it is web application,use this function to focus any control.
for this use a namespace,
using System.Text


void Focus(System.Web.UI.Control controlToFocus)
                {
                        StringBuilder scriptFunction = new StringBuilder();
                        string clientid; 
                        clientid = controlToFocus.ClientID;
                        scriptFunction.Append("<Script language='javascript'>");
                        scriptFunction.Append(" if (document.getElementById('");
                        scriptFunction.Append(clientid);
                        scriptFunction.Append("')!=null){");
                        scriptFunction.Append("document.getElementById('");
                        scriptFunction.Append(clientid);
                        scriptFunction.Append("').focus();}");
                        scriptFunction.Append("window.history.forward(1);");
                        scriptFunction.Append("</script>");
                        Page.RegisterStartupScript("focus", scriptFunction.ToString());
                }

just call Focus(Button1)



Best Regards,
muthu

M Muthuraman
[EMAIL PROTECTED] 
Software Engineer
COMPUSOL Software Pvt. Ltd.
#28, P.T Street, Southend Circle
Basavanagudi,
Bangalore - 560 004
Ph: 080-30617800
Mobile:080-36908455
Visit us at: www.compusolsoftware.com 



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

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/bdotnet/_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