I am facing lot of problems when i am using AutoCompleteExtender while accessing in google chrome and safari i tried your suggested solution but still its not working for me.
Please help me its very very urgent to fix this issue as i have a release next week
<ajaxToolkit:AutoCompleteExtender id="autoComplete1" runat="server" CompletionListHighlightedItemCssClass="autocomplete_highlightedListItem" CompletionListItemCssClass="autocomplete_listItem" CompletionListCssClass="autocomplete_completionListElement" UseContextKey="True"
ServiceMethod="GetCompletionList" MinimumPrefixLength="1" CompletionSetCount="30" EnableCaching="false" CompletionInterval="500" TargetControlID="companytxt" BehaviorID="AutoCompleteEx">
<Animations>
<OnShow>
<Sequence>
<%-- Make the completion list transparent and then show it --%>
<OpacityAction Opacity="0" />
<HideAction Visible="true" />
<%--Cache the original size of the completion list the first time
the animation is played and then set it to zero --%>
<ScriptAction Script="
// Cache the size and setup the initial size
var behavior = $find('AutoCompleteEx');
if (!behavior._height) {
var target = behavior.get_completionList();
behavior._height = target.offsetHeight - 2;
target.style.height = '0px';
}" />
<%-- Expand from 0px to the appropriate size while fading in --%>
<Parallel Duration=".4">
<FadeIn />
<Length PropertyKey="height" StartValue="0" EndValueScript="$find('AutoCompleteEx')._height" />
</Parallel>
</Sequence>
</OnShow>
<OnHide>
<%-- Collapse down to 0px and fade out --%>
<Parallel Duration=".4">
<FadeOut />
<Length PropertyKey="height" StartValueScript="$find('AutoCompleteEx')._height" EndValue="0" />
</Parallel>
</OnHide>
</Animations>
</ajaxToolkit:AutoCompleteExtender>
Hey How come its still not working for me. Which versions of chrome and safari you are using. Please check and tell is there any code errors or anything else i am missing so i can also get it worked out.
Have you debugged the client script to make sure the IF block is being entered? A simple alert('hello, world'); statement will tell you if the browser is being detected by the javascript.
What is the full UserAgent string being returned by the gchrome and safari versions you're using?
Do other AJAX CT controls have problems on the same page? Have you tried removing the animation from the autocomplete?
My Signature: Mark a post as answered if it helped you, or don't, it makes no difference to me. Just PLEASE try not to use the word "random" when describing your problem.
If you don't want to replace the MicrosoftAjax file and/or modify it there is a very simple solution. You can just implement taliesins solution after the document has been loaded or simply right after that file has been loaded. So just create a js file that
gets loaded after the MicrosoftAjax.js with this in it: function patchMicrosoftAjax() { Sys.Browser = {}; Sys.Browser.InternetExplorer = {}; Sys.Browser.Firefox = {}; Sys.Browser.WebKit = {}; //Safari 3 is considered WebKit Sys.Browser.Safari = {}; Sys.Browser.Opera
= {}; Sys.Browser.agent = null; Sys.Browser.hasDebuggerStatement = false; Sys.Browser.name = navigator.appName; Sys.Browser.version = parseFloat(navigator.appVersion); if (navigator.userAgent.indexOf(' MSIE ') > -1) { Sys.Browser.agent = Sys.Browser.InternetExplorer;
Sys.Browser.version = parseFloat(navigator.userAgent.match(/MSIE (\d+\.\d+)/)[1]); Sys.Browser.hasDebuggerStatement = true; } else if (navigator.userAgent.indexOf(' Firefox/') > -1) { Sys.Browser.agent = Sys.Browser.Firefox; Sys.Browser.version = parseFloat(navigator.userAgent.match(/
Firefox\/(\d+\.\d+)/)[1]); Sys.Browser.name = 'Firefox'; Sys.Browser.hasDebuggerStatement = true; } else if (navigator.userAgent.indexOf('WebKit/') > -1) { Sys.Browser.agent = Sys.Browser.WebKit; Sys.Browser.version = parseFloat(navigator.userAgent.match(/WebKit\/(\d+(\.\d+)?)/)[1]);
Sys.Browser.name = 'WebKit'; } else if (navigator.userAgent.indexOf(' Safari/') > -1) { Sys.Browser.agent = Sys.Browser.Safari; Sys.Browser.version = parseFloat(navigator.userAgent.match(/ Safari\/(\d+(\.\d+)?)/)[1]); Sys.Browser.name = 'Safari'; } else if
(navigator.userAgent.indexOf('Opera/') > -1) { Sys.Browser.agent = Sys.Browser.Opera; } } // Run this if you can ensure this file is placed after MicrosoftAjax.js patchMicrosoftAjax(); // Run this if you cannot ensure this file is placed after MicrosoftAjax.js
and if you are using jQuery $(patchMicrosoftAjax); // or jQuery(patchMicrosoftAjax); // or $.$(document).ready(function() { patchMicrosoftAjax(); });
BobbyRich
Member
26 Points
18 Posts
Re: Compatibility patch for WebKit (Safari 3) 3.5.21022.8 MicrosoftAjax.debug.en-US.js
Mar 20, 2009 09:48 PM|LINK
gri4
Member
28 Points
17 Posts
Re: Compatibility patch for WebKit (Safari 3) 3.5.21022.8 MicrosoftAjax.debug.en-US.js
Apr 21, 2009 08:19 AM|LINK
Also got this bug. Guys, thanks for the solution!
csnaveen31
Member
9 Points
3 Posts
Re: Compatibility patch for WebKit (Safari 3) 3.5.21022.8 MicrosoftAjax.debug.en-US.js
Apr 25, 2009 01:05 PM|LINK
I am facing lot of problems when i am using AutoCompleteExtender while accessing in google chrome and safari i tried your suggested solution but still its not working for me.
Please help me its very very urgent to fix this issue as i have a release next week
The i have used is as follows :
<ajaxToolkit:ToolkitScriptManager runat="server" ID="ScriptManager1" ScriptMode="Release" EnablePageMethods="True" CombineScripts="true">
<Scripts>
<asp:ScriptReference Path="~/scripts/webkit.js" />
</Scripts>
</ajaxToolkit:ToolkitScriptManager>
Where ajaxToolkit is the registered prefix for AjaxControlToolkit and the script file webkit.js contains the following code:
Sys.Browser.WebKit = {}; //Safari 3 is considered WebKit
if( navigator.userAgent.indexOf( 'WebKit/' ) > -1 )
{
Sys.Browser.agent = Sys.Browser.WebKit;
Sys.Browser.agent = Sys.Browser.WebKit;
Sys.Browser.version = parseFloat( navigator.userAgent.match(/WebKit\/(\d+(\.\d+)?)/)[1]);
Sys.Browser.name = 'WebKit';
}
AutoCompleteExtender code is as follows :
<ajaxToolkit:AutoCompleteExtender id="autoComplete1" runat="server" CompletionListHighlightedItemCssClass="autocomplete_highlightedListItem" CompletionListItemCssClass="autocomplete_listItem" CompletionListCssClass="autocomplete_completionListElement" UseContextKey="True" ServiceMethod="GetCompletionList" MinimumPrefixLength="1" CompletionSetCount="30" EnableCaching="false" CompletionInterval="500" TargetControlID="companytxt" BehaviorID="AutoCompleteEx">
<Animations>
<OnShow>
<Sequence>
<%-- Make the completion list transparent and then show it --%>
<OpacityAction Opacity="0" />
<HideAction Visible="true" />
<%--Cache the original size of the completion list the first time
the animation is played and then set it to zero --%>
<ScriptAction Script="
// Cache the size and setup the initial size
var behavior = $find('AutoCompleteEx');
if (!behavior._height) {
var target = behavior.get_completionList();
behavior._height = target.offsetHeight - 2;
target.style.height = '0px';
}" />
<%-- Expand from 0px to the appropriate size while fading in --%>
<Parallel Duration=".4">
<FadeIn />
<Length PropertyKey="height" StartValue="0" EndValueScript="$find('AutoCompleteEx')._height" />
</Parallel>
</Sequence>
</OnShow>
<OnHide>
<%-- Collapse down to 0px and fade out --%>
<Parallel Duration=".4">
<FadeOut />
<Length PropertyKey="height" StartValueScript="$find('AutoCompleteEx')._height" EndValue="0" />
</Parallel>
</OnHide>
</Animations>
</ajaxToolkit:AutoCompleteExtender>
zarzar
Member
18 Points
14 Posts
Re: Compatibility patch for WebKit (Safari 3) 3.5.21022.8 MicrosoftAjax.debug.en-US.js
Apr 27, 2009 12:32 PM|LINK
I've been using this hack since today to solve my problem with AJAX CT in G.Chrome & Safari
Thanks !
csnaveen31
Member
9 Points
3 Posts
Re: Compatibility patch for WebKit (Safari 3) 3.5.21022.8 MicrosoftAjax.debug.en-US.js
Apr 28, 2009 04:09 AM|LINK
Hey How come its still not working for me. Which versions of chrome and safari you are using. Please check and tell is there any code errors or anything else i am missing so i can also get it worked out.
Thanks
zarzar
Member
18 Points
14 Posts
Re: Compatibility patch for WebKit (Safari 3) 3.5.21022.8 MicrosoftAjax.debug.en-US.js
Apr 28, 2009 07:09 AM|LINK
I'm using :
gri4
Member
28 Points
17 Posts
Re: Compatibility patch for WebKit (Safari 3) 3.5.21022.8 MicrosoftAjax.debug.en-US.js
Apr 28, 2009 08:08 AM|LINK
I have tested it with safari 4 (528.16)
Are you sure that you have exactly the same error that described in the first post ?
danludwig
Contributor
3020 Points
601 Posts
Re: Compatibility patch for WebKit (Safari 3) 3.5.21022.8 MicrosoftAjax.debug.en-US.js
Apr 28, 2009 10:14 AM|LINK
Have you debugged the client script to make sure the IF block is being entered? A simple alert('hello, world'); statement will tell you if the browser is being detected by the javascript.
What is the full UserAgent string being returned by the gchrome and safari versions you're using?
Do other AJAX CT controls have problems on the same page? Have you tried removing the animation from the autocomplete?
badeen
Member
2 Points
1 Post
Re: Compatibility patch for WebKit (Safari 3) 3.5.21022.8 MicrosoftAjax.debug.en-US.js
May 01, 2009 07:25 PM|LINK
Safari Webkit
tarzaan
Member
88 Points
29 Posts
Re: Compatibility patch for WebKit (Safari 3) 3.5.21022.8 MicrosoftAjax.debug.en-US.js
Aug 07, 2009 08:01 AM|LINK
Worked for me and easily saved me a few days of stress.
Thanks so much for the help.