By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,917 Members | 1,730 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,917 IT Pros & Developers. It's quick & easy.

onload event doesn't work properly with smart nav turned on

P: n/a
Hi,

I have a web form with smart navigation turned on. the html has an
onload event which calls a javascript function and the contents of this
function are dynamically generated on the server like this:

function onload() {
<% if (some_condition) { %>
do_some_javascript();
<% } %>
}

the "some condition" is initially false but may be set to true after a
postback.

For one particular user, after doing a postback, the javascript does
not get executed, so it's as if either the onload isn't firing at all
or the javascript function that's being run is the old one that was
generated before the postback.

the strange thing is that for most users everything works fine. the
user that has the problem is using the latest IE on XP SP2 - the same
combination as many other users. I am pretty sure it's not some popup
blocker or other security filter because if I disable smart navigation
it works. I can't afford to disable smart navigation on this form for
the sake of one user though.

anyone have any ideas what might be causing this?

Andy

Dec 21 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Andy,

I've seen a lot of quirks with smart navigation turned on. In fact this
forum has had many posts about them.

I've found that turning smart navigation on and off during certain post
backs has allowed me to use it fairly successfully. If during the postback
in question you can turn smart navigation off and then back on again if
needed that may fix your problem.

If your problem isn't fixed by turning smart navigation off from within your
code-behind you may want to look at an alternative to smart navigation
altogether. I made a javascript component that I give away for free (with
source code and help file). It has a ScrollToElement method in it that using
javascript automatically scrolls a page so that the given control is at the
top of the page. You might want to replace using smart navigation with a
similar script. You may see a demo of how this works and download the source
code from: http://www.aboutfortunate.com?page=javascriptdemo.
--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
<aj****@blueyonder.co.uk> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Hi,

I have a web form with smart navigation turned on. the html has an
onload event which calls a javascript function and the contents of this
function are dynamically generated on the server like this:

function onload() {
<% if (some_condition) { %>
do_some_javascript();
<% } %>
}

the "some condition" is initially false but may be set to true after a
postback.

For one particular user, after doing a postback, the javascript does
not get executed, so it's as if either the onload isn't firing at all
or the javascript function that's being run is the old one that was
generated before the postback.

the strange thing is that for most users everything works fine. the
user that has the problem is using the latest IE on XP SP2 - the same
combination as many other users. I am pretty sure it's not some popup
blocker or other security filter because if I disable smart navigation
it works. I can't afford to disable smart navigation on this form for
the sake of one user though.

anyone have any ideas what might be causing this?

Andy

Dec 21 '05 #2

P: n/a
Thanks for the advice, I'll try out these ideas.

I just wish I could work out why only 1 user out of several hundred has a
problem with this form though. SmartNavigation is mostly working perfectly.

"S. Justin Gengo" <justin@[no_spam_please]aboutfortunate.com> wrote in
message news:OS****************@TK2MSFTNGP14.phx.gbl...
Andy,

I've seen a lot of quirks with smart navigation turned on. In fact this
forum has had many posts about them.

I've found that turning smart navigation on and off during certain post
backs has allowed me to use it fairly successfully. If during the postback
in question you can turn smart navigation off and then back on again if
needed that may fix your problem.

If your problem isn't fixed by turning smart navigation off from within
your code-behind you may want to look at an alternative to smart
navigation altogether. I made a javascript component that I give away for
free (with source code and help file). It has a ScrollToElement method in
it that using javascript automatically scrolls a page so that the given
control is at the top of the page. You might want to replace using smart
navigation with a similar script. You may see a demo of how this works and
download the source code from:
http://www.aboutfortunate.com?page=javascriptdemo.
--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
<aj****@blueyonder.co.uk> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Hi,

I have a web form with smart navigation turned on. the html has an
onload event which calls a javascript function and the contents of this
function are dynamically generated on the server like this:

function onload() {
<% if (some_condition) { %>
do_some_javascript();
<% } %>
}

the "some condition" is initially false but may be set to true after a
postback.

For one particular user, after doing a postback, the javascript does
not get executed, so it's as if either the onload isn't firing at all
or the javascript function that's being run is the old one that was
generated before the postback.

the strange thing is that for most users everything works fine. the
user that has the problem is using the latest IE on XP SP2 - the same
combination as many other users. I am pretty sure it's not some popup
blocker or other security filter because if I disable smart navigation
it works. I can't afford to disable smart navigation on this form for
the sake of one user though.

anyone have any ideas what might be causing this?

Andy


Dec 23 '05 #3

P: n/a
Andy,

I have seen website pages act differently for users who have the same
systems and software but who don't have the same service packs installed.
Have the user who is experiencing the problems run autoupdate to make
certain that actually have all the latest updates. That may be the problem.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Andy Fish" <aj****@blueyonder.co.uk> wrote in message
news:ui**************@TK2MSFTNGP12.phx.gbl...
Thanks for the advice, I'll try out these ideas.

I just wish I could work out why only 1 user out of several hundred has a
problem with this form though. SmartNavigation is mostly working
perfectly.

"S. Justin Gengo" <justin@[no_spam_please]aboutfortunate.com> wrote in
message news:OS****************@TK2MSFTNGP14.phx.gbl...
Andy,

I've seen a lot of quirks with smart navigation turned on. In fact this
forum has had many posts about them.

I've found that turning smart navigation on and off during certain post
backs has allowed me to use it fairly successfully. If during the
postback in question you can turn smart navigation off and then back on
again if needed that may fix your problem.

If your problem isn't fixed by turning smart navigation off from within
your code-behind you may want to look at an alternative to smart
navigation altogether. I made a javascript component that I give away for
free (with source code and help file). It has a ScrollToElement method in
it that using javascript automatically scrolls a page so that the given
control is at the top of the page. You might want to replace using smart
navigation with a similar script. You may see a demo of how this works
and download the source code from:
http://www.aboutfortunate.com?page=javascriptdemo.
--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
<aj****@blueyonder.co.uk> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Hi,

I have a web form with smart navigation turned on. the html has an
onload event which calls a javascript function and the contents of this
function are dynamically generated on the server like this:

function onload() {
<% if (some_condition) { %>
do_some_javascript();
<% } %>
}

the "some condition" is initially false but may be set to true after a
postback.

For one particular user, after doing a postback, the javascript does
not get executed, so it's as if either the onload isn't firing at all
or the javascript function that's being run is the old one that was
generated before the postback.

the strange thing is that for most users everything works fine. the
user that has the problem is using the latest IE on XP SP2 - the same
combination as many other users. I am pretty sure it's not some popup
blocker or other security filter because if I disable smart navigation
it works. I can't afford to disable smart navigation on this form for
the sake of one user though.

anyone have any ideas what might be causing this?

Andy



Dec 27 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.