473,322 Members | 1,188 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

HELP! Page.RegisterStartupScript not working right in firefox

Dav
In my ASP.NET codebehind I have the following code to jump to a certain
section of the page:

---
Dim strAnchorScript As String = "<script language='javascript'>" & _
"window.location.hash='#" & strLink & "'</script>"

Page.RegisterStartupScript("anchorScript", strAnchorScript
---

In IE when it loads the page it jumps to a certain section of the page.
For firefox it just loads the page. But if I refresh the page in
firefox it jumps to the the section I want.

So, how do I get this to work in firefox (to use
Page.RegisterStartupScript and to jump to a certain place on the page)?
This seems like the easiest way to jump to a certian page.

Please post your answer here (no emails) and no flames.

Thanks for you help!

Dec 21 '06 #1
2 4649
Hi,
I suspect there are some probematic characters in strLink.Try
escape(strLink) and see if it is working or not.

Thanks and Regards,
Manish Bafna.
MCP and MCTS.

"Dav" wrote:
In my ASP.NET codebehind I have the following code to jump to a certain
section of the page:

---
Dim strAnchorScript As String = "<script language='javascript'>" & _
"window.location.hash='#" & strLink & "'</script>"

Page.RegisterStartupScript("anchorScript", strAnchorScript
---

In IE when it loads the page it jumps to a certain section of the page.
For firefox it just loads the page. But if I refresh the page in
firefox it jumps to the the section I want.

So, how do I get this to work in firefox (to use
Page.RegisterStartupScript and to jump to a certain place on the page)?
This seems like the easiest way to jump to a certian page.

Please post your answer here (no emails) and no flames.

Thanks for you help!

Dec 21 '06 #2
"Dav" <mu**********@yahoo.comwrote in message
news:11*********************@i12g2000cwa.googlegro ups.com...
In my ASP.NET codebehind I have the following code to jump to a certain
section of the page:
Dim strAnchorScript As String = "<script language='javascript'>" & _
"window.location.hash='#" & strLink & "'</script>"

Page.RegisterStartupScript("anchorScript", strAnchorScript
Well, the first thing to do is to eliminate your outdated non
XHTML-compliant script declaration:

"<script language='javascript'>"

is deprecated in favour of:

"<script type='text/javascript'>"

I'm not saying that will definitely solve it but, when things work in IE and
not in other browsers, it's almost always because of IE's non-standard
behaviour.
In IE when it loads the page it jumps to a certain section of the page.
For firefox it just loads the page. But if I refresh the page in
firefox it jumps to the the section I want.
Second thing to do is to examine the source in IE and FireFox - what's
different...?
So, how do I get this to work in firefox (to use
Page.RegisterStartupScript and to jump to a certain place on the page)?
This seems like the easiest way to jump to a certian page.
Yes, it certainly should work. However, might it be that it doesn't work in
FireFox the first time because of script placement? I.e. is FireFox trying
to run the code too early, before the whole page has been completely built?
See here:
http://www.experts-exchange.com/Web/..._21622556.html
Dec 21 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
by: Dave | last post by:
After following Microsofts admonition to reformat my system before doing a final compilation of my app I got many warnings/errors upon compiling an rtf file created in word. I used the Help...
4
by: Sarir Khamsi | last post by:
Is there a way to get help the way you get it from the Python interpreter (eg, 'help(dir)' gives help on the 'dir' command) in the module cmd.Cmd? I know how to add commands and help text to...
2
by: Sudheer Kareem | last post by:
Dear All Please tell me how to assosiate help files with my Vb.net Project. Regards Sudheer
6
by: wukexin | last post by:
Help me, good men. I find mang books that introduce bit "mang header files",they talk too bit,in fact it is my too fool, I don't learn it, I have do a test program, but I have no correct doing...
6
by: d.warnermurray | last post by:
I am doing a project for school that involves creating help files for a html authoring tool. If you could help me with answers to some questions it would really help. 1. What tasks do you expect...
0
by: tbatwork828 | last post by:
If you were like me trying to figure out how to launch context sensitive help topic by the context id, here is the link: http://weblogs.asp.net/kencox/archive/2004/09/12/228349.aspx and if...
7
by: Corepaul | last post by:
Missing Help Files When I enter "recordset" as the keyword and search the Visual Basic Help index, I get many topics of interest in the resulting list. But there isn't any information available...
8
by: Mark | last post by:
I have loaded Visual Studio .net on my home computer and my laptop, but my home computer has an abbreviated help screen not 2% of the help on my laptop. All the settings look the same on both...
1
by: trunxnirvana007 | last post by:
'UPGRADE_WARNING: Array has a new behavior. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="9B7D5ADD-D8FE-4819-A36C-6DEDAF088CC7"' 'UPGRADE_WARNING: Couldn't resolve...
6
by: priyajohal | last post by:
#include<fstream.h> #include<process.h> #include<stdlib.h> #include<conio.h> #include<string.h> #include<dos.h> #include<ctype.h> #include<stdio.h> void setup() void help();
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.