But the issue I am facing is ,this particular function is being called by ajax by default, where in I cannot change that. Kindly let me know if this can be solved. I am looking for a permament fix for ie11.
undefined value is being returned in ie 11 where as in ie 10 , it is returning the current length of the text in the combo box.
This is leading to failure.
Hi k3627,
I'm glad to you post the issue to asp.net forum.
As we all known, document.selection support was removed in IE10 and replaced with window.getSelection.
Each Ajax control and extender is associated with a Javascript file named as
Behaviour.js . This file contains those functions which
specify the behaviors of these controls and extenders. If we want to customize any behavior of these controls or extenders we can
update the source code.
you can update the source code to solve the issue using below link.
if (window.getSelection) { // all browsers, except IE before version 9
var selectionRange = window.getSelection();
return selectionRange.toString ());
}
else {
if (document.selection.type == 'None') {
// alert ("No content is selected, or the selected content is not available!");
}
else {
var textRange = document.selection.createRange ();
return textRange.text;
}
}
Hope this helps. Thanks.
Best Regards!
We are trying to better understand customer views on social support experience. Click HERE to participate the survey. Thanks!
After some trial and error I found the solution for the problem. I modified the below code combobox.pre.js file in source code and used the custom build dll in my application . Hope it may be use full to others.
_getTextSelectionInfo:
function
(textBox, e) {
//
returns a helper object with information about textbox selection
var
info = new
Object();
//
strategy
info.strategy =
this._getTextSelectionStrategy();
//
selectionStart & selectionEnd
if
(info.strategy == Sys.Extended.UI.ComboBoxTextSelectionStrategy.Microsoft) {
info.selectionStart = 0;
info.selectionEnd = textBox.value.length;
var
userRange;
if
(window.getSelection) { //
all browsers, except IE before version 9
//Modified
code start for IE 11
info.selectionStart = textBox.selectionStart;
info.selectionEnd = textBox.selectionEnd;
//Modified
code end for IE 11
}
else
{
userRange = document.selection.createRange();
while
(userRange.moveStart('character',
-1) != 0) {
None
0 Points
4 Posts
Ajax combo box issue in ie 11
Oct 29, 2013 08:28 AM|k3627|LINK
I am facing an issue with ajax combo box in ie 11, where the intellisense feature is not working.
In the below code which is executed in script resource.axd
var userRange = document.selection.createRange();
undefined value is being returned in ie 11 where as in ie 10 , it is returning the current length of the text in the combo box.
This is leading to failure.
Any suggestions/workarounds would be of great assitance.
I used the latest available ajax components updated using nuget.
Thanks in advance
code:
_getTextSelectionInfo: function (textBox, e) {
var info = new Object();
info.strategy = this._getTextSelectionStrategy();
if (info.strategy == Sys.Extended.UI.ComboBoxTextSelectionStrategy.Microsoft) {
var userRange = document.selection.createRange();
info.selectionStart = 0;
info.selectionEnd = textBox.value.length;
while (userRange.moveStart('character', -1) != 0) {
info.selectionStart++;
}
while (userRange.moveEnd('character', 1) != 0) {
info.selectionEnd--;
}
}
else if (info.strategy == Sys.Extended.UI.ComboBoxTextSelectionStrategy.W3C) {
info.selectionStart = textBox.selectionStart;
info.selectionEnd = textBox.selectionEnd;
}
info.typedCharacter = String.fromCharCode(e.charCode);
info.textBoxValue = textBox.value;
info.selectionPrefix = (info.textBoxValue.length >= info.selectionStart)
? info.textBoxValue.substring(0, info.selectionStart)
: '';
info.selectionText = (info.textBoxValue.length >= info.selectionEnd)
? info.textBoxValue.substring(info.selectionStart, info.selectionEnd)
: '';
info.selectionSuffix = (info.textBoxValue.length >= info.selectionEnd)
? info.textBoxValue.substring(info.selectionEnd, info.textBoxValue.length)
: '';
info.selectionTextFirst = info.selectionText.substring(0, 1);
return info;
},
Participant
1076 Points
320 Posts
MVP
Re: Ajax combo box issue in ie 11
Oct 29, 2013 01:50 PM|kashyapa|LINK
there is a breaking chage w.r.t selection in IE11.
documemt.selection is replaced with window.getSelection
check out the changes here:
http://msdn.microsoft.com/en-us/library/ie/bg182625(v=vs.85).aspx
javascript IE11
http://about.me/kashyapa
None
0 Points
4 Posts
Re: Ajax combo box issue in ie 11
Oct 30, 2013 01:05 AM|k3627|LINK
Thank you kashyapa.
I am aware of the change made in IE 11.
But the issue I am facing is ,this particular function is being called by ajax by default, where in I cannot change that. Kindly let me know if this can be solved. I am looking for a permament fix for ie11.
ajax javascript IE11
All-Star
30411 Points
3628 Posts
Re: Ajax combo box issue in ie 11
Oct 31, 2013 03:38 AM|Fuxiang Zhang - MSFT|LINK
Hi k3627,
I'm glad to you post the issue to asp.net forum.
As we all known, document.selection support was removed in IE10 and replaced with window.getSelection.
Each Ajax control and extender is associated with a Javascript file named as Behaviour.js . This file contains those functions which
specify the behaviors of these controls and extenders. If we want to customize any behavior of these controls or extenders we can update the source code.
you can update the source code to solve the issue using below link.
Hope this helps. Thanks.
Best Regards!
All-Star
48393 Points
12161 Posts
Re: Ajax combo box issue in ie 11
Nov 01, 2013 12:15 AM|chetan.sarode|LINK
IE 11 has been just launched with windows 8.1, so we'll have to wait for next release of AJAXControlToolkit, you can report issue here
http://ajaxcontroltoolkit.codeplex.com/workitem/list/basic
Team Lead, Product Development
Approva Systems Pvt Ltd, Pune, India.
None
0 Points
7 Posts
Re: Ajax combo box issue in ie 11
Dec 19, 2013 05:51 AM|Udaii|LINK
Hi Fuxiang,
updating source code means??
you mean behaviour.js??? if so how??
please help me in understanding this..??
None
0 Points
4 Posts
Re: Ajax combo box issue in ie 11
Dec 23, 2013 01:00 AM|k3627|LINK
After some trial and error I found the solution for the problem. I modified the below code combobox.pre.js file in source code and used the custom build dll in my application . Hope it may be use full to others.
_getTextSelectionInfo:
function (textBox, e) {
// returns a helper object with information about textbox selection
var info = new Object();
// strategy
info.strategy =
this._getTextSelectionStrategy();
// selectionStart & selectionEnd
if (info.strategy == Sys.Extended.UI.ComboBoxTextSelectionStrategy.Microsoft) {
info.selectionStart = 0;
info.selectionEnd = textBox.value.length;
var userRange;
if (window.getSelection) { // all browsers, except IE before version 9
//Modified code start for IE 11
info.selectionStart = textBox.selectionStart;
info.selectionEnd = textBox.selectionEnd;
//Modified code end for IE 11
}
else {
userRange = document.selection.createRange();
while (userRange.moveStart('character', -1) != 0) {
info.selectionStart++;
}
while (userRange.moveEnd('character', 1) != 0) {
info.selectionEnd--;
}
}
}
else if (info.strategy == Sys.Extended.UI.ComboBoxTextSelectionStrategy.W3C) {
info.selectionStart = textBox.selectionStart;
info.selectionEnd = textBox.selectionEnd;
}
// typedCharacter, textBoxValue, selectionPrefix, selectionSuffix, selectionTextFirst
info.typedCharacter = String.fromCharCode(e.charCode);
info.textBoxValue = textBox.value;
info.selectionPrefix = (info.textBoxValue.length >= info.selectionStart)
? info.textBoxValue.substring(0, info.selectionStart) :'';
info.selectionText = (info.textBoxValue.length >= info.selectionEnd)
? info.textBoxValue.substring(info.selectionStart, info.selectionEnd) : '';
info.selectionSuffix = (info.textBoxValue.length >= info.selectionEnd)
? info.textBoxValue.substring(info.selectionEnd, info.textBoxValue.length) :'';
info.selectionTextFirst = info.selectionText.substring(0, 1);return info;
},