Im using two radtextboxes within GridTemplateColumns. Im trying to use an onblur event but when I make some tests for some reazon, the attached function is firing several times. What is causing this behavior?
Aspx
1.
<
telerik:GridTemplateColumn
UniqueName
=
"VisibleAccCode"
HeaderText
=
"Código Cuenta"
2.
HeaderStyle-HorizontalAlign
=
"Center"
3.
ItemStyle-HorizontalAlign
=
"Center"
HeaderStyle-Width
=
"250px"
>
4.
<
ItemTemplate
>
5.
<
telerik:RadTextBox
ID
=
"TxtAccCode"
runat
=
"server"
Width
=
"85%"
/>
6.
</
ItemTemplate
>
7.
</
telerik:GridTemplateColumn
>
VB
01.
Dim
TxtAccCode
As
RadTextBox =
CType
(item.FindControl(
"TxtAccCode"
), RadTextBox)
02.
Dim
TxtAcctName
As
RadTextBox =
CType
(item.FindControl(
"TxtAcctName"
), RadTextBox)
03.
04.
Dim
sJsFunction
As
String
05.
06.
sJsFunction =
"function (s,a){BuscarAccCode(s,a,"
& RowIndex &
");}"
07.
08.
If
TxtAccCode IsNot
Nothing
Then
09.
TxtAccCode.ClientEvents.OnBlur = sJsFunction
10.
End
If
11.
12.
sJsFunction =
"function (s,a){BuscarAccName(s,a,"
& RowIndex &
");}"
13.
14.
If
TxtAcctName IsNot
Nothing
Then
15.
TxtAcctName.ClientEvents.OnBlur = sJsFunction
16.
End
If
Jscript
1.
function
BuscarAccCode(sender, eventArgs, rowIndex) {
2.
alert(sender.get_id() +
' index '
+ rowIndex);
3.
}
4.
5.
function
BuscarAccName(sender, eventArgs, rowIndex) {
6.
alert(sender.get_id() +
' index '
+ rowIndex);
7.
}