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

A

ajfish

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
 
S

S. Justin Gengo

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
 
A

Andy Fish

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

S. Justin Gengo

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top