& Lt; % @ PageLanguage & quot; C # & quot; AutoEventWireup & quot; true & quot; AspCompat & quot; true & quot; CodeBehind & quot; WebForm1.aspx. cs & quot; Inherits & quot; SJLERP. webForm1 & quot
<% @ Page Language = "C #" AutoEventWireup = "true" AspCompat = "true" CodeBehind = "WebForm1.aspx. cs"
Inherits = "SJLERP. WebForm1" %>
Function setCaret (textObj ){
If (textObj. createTextRange ){
TextObj. caretPos = document. selection. createRange (). duplicate ();
}
}
Function insertAtCaret (textObj, textFeildValue ){
If (document. all ){
If (textObj. createTextRange & textObj. caretPos ){
Var caretPos = textObj. caretPos;
CaretPos. text = caretPos. text. charAt (caretPos. text. length-1) = ''? TextFeildValue + '': textFeildValue;
} Else {
TextObj. value = textFeildValue;
}
} Else {
If (textObj. setSelectionRange ){
Var rangeStart = textObj. selectionStart;
Var rangeEnd = textObj. selectionEnd;
Var tempStr1 = textObj. value. substring (0, rangeStart );
Var tempStr2 = textObj. value. substring (rangeEnd );
TextObj. value = tempStr1 + textFeildValue + tempStr2;
} Else {
Alert ("This version of Mozilla based browser does not support setSelectionRange ");
}
}
}
Script