S
sck10
Hello,
I am trying to add the following to a App_Code class. The error I am
getting is "The name 'ClientScript' does not exist in the current context".
I would like to call this from my content page which uses MasterPages. Any
help with this would be appreciated...
Thanks, sck10
public void SetFocusControl(Control FocusControl)
{
StringBuilder script = new StringBuilder();
string ClientID = FocusControl.ClientID;
script.Append("<script language='javascript'>");
script.Append("document.getElementById('");
script.Append(ClientID);
script.Append("').focus();");
script.Append("</script>");
ClientScript.RegisterStartupScript(this.GetType(), "SetFocusControl",
script.ToString());
}
I am trying to add the following to a App_Code class. The error I am
getting is "The name 'ClientScript' does not exist in the current context".
I would like to call this from my content page which uses MasterPages. Any
help with this would be appreciated...
Thanks, sck10
public void SetFocusControl(Control FocusControl)
{
StringBuilder script = new StringBuilder();
string ClientID = FocusControl.ClientID;
script.Append("<script language='javascript'>");
script.Append("document.getElementById('");
script.Append(ClientID);
script.Append("').focus();");
script.Append("</script>");
ClientScript.RegisterStartupScript(this.GetType(), "SetFocusControl",
script.ToString());
}