Friday, December 17, 2010

How to set the focus on controls when ajax toolkit modal popup comes true

1)In which control you want to focus set this as behaviour id of modalpopup
2)use this code block
In following example we set the focus on emergency code text box.

if ((!Page.ClientScript.IsStartupScriptRegistered("Startup"))) {
StringBuilder sb = new StringBuilder();
sb.Append("");
Page.ClientScript.RegisterStartupScript(Page.GetType(), "Startup", sb.ToString());

Thanks
Mahesh K. Sharma

No comments: