I'm trying to register a script to enable me to set the foucs to a particular object on my ASP.NET page.
//Script for focus
string Focus = "";
Focus += "\n<script language=JavaScript id='Focus'>\n";
Focus += "Log.txtDCUG.DialledNum.Focus();\n";
Focus += "Log.txtDCUG.DialledNum.Select();\n";
Focus += "</script>";
//Check whether they are already registered
if(!IsStartupScriptRegistered("Focus"
)
{
//Register the script
RegisterStartupScript("Focus",Focus);
}
Can anybody tell me what is wrong with my syntax, as I'm the syntax when making reference to Javascripts.
Thanks,
Mike
//Script for focus
string Focus = "";
Focus += "\n<script language=JavaScript id='Focus'>\n";
Focus += "Log.txtDCUG.DialledNum.Focus();\n";
Focus += "Log.txtDCUG.DialledNum.Select();\n";
Focus += "</script>";
//Check whether they are already registered
if(!IsStartupScriptRegistered("Focus"
{
//Register the script
RegisterStartupScript("Focus",Focus);
}
Can anybody tell me what is wrong with my syntax, as I'm the syntax when making reference to Javascripts.
Thanks,
Mike