onBlur() イベントがないため、基本的に RadTextBox を拡張するカスタム Web コントロールを作成しています。.ascx ファイルにスクリプトを追加しました。スクリプトを登録しようとしていますが、失敗します。ここで何が欠けているのかわかりません。
<script language="javascript">
function handleLostFocus(o) {
aler(o.toString());
}
</script>
public partial class MyTextBox : RadTextBox, IScriptControl
{
private void RegisterScripts()
{
try
{
String csname1 = "handleLostFocus";
Type cstype = this.GetType();
String cstext1 = "alert('Hello World');";
ScriptManager.RegisterStartupScript(this, cstype, csname1, cstext1, true);
}
catch (Exception ex)
{
}
}
public MyTextBox()
{
Attributes.Add("padding", "5px");
Skin = "Office2007";
Attributes.Add("onBlur", "handleLostFocus(this);");
RegisterScripts();
}
}