473,465 Members | 1,379 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

RegisterStartupScript doesn't work in a aspx page containing a frameset

I have an aspx page which contains a frameset.

I want to set the location.href of the frames dynamically using javascript
created in the Page_Load of the frameset using RegisterStartupScript, but
the registered script doesn't appear to run. Is there some reason why
RegisterStartupScript won't work in a aspx page containing a frameset?
Aug 28 '07 #1
6 4333
I have an aspx page which contains a frameset.
>
I want to set the location.href of the frames dynamically using
javascript created in the Page_Load of the frameset using
RegisterStartupScript, but the registered script doesn't appear to
run. Is there some reason why RegisterStartupScript won't work in a
aspx page containing a frameset?
When you view the html source of that frameset page as it was
received by the browser, do you see the javascript there?

Just a wild guess: will javascript work in a frameset page? (I expect
it does, but you never know ...)

Hans Kesting
Aug 29 '07 #2
"Hans Kesting" <ne***********@spamgourmet.comwrote in message
news:c0**************************@news.microsoft.c om...
Just a wild guess: will javascript work in a frameset page?
Yes.
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Aug 29 '07 #3
Thank you for the response.

I know that javascript works in a frameset page.

The problem is that when I attempt to insert javascript using
RegisterStartupScript in a frameset page the javascript is not created.

-Bill
"Hans Kesting" <ne***********@spamgourmet.comwrote in message
news:c0**************************@news.microsoft.c om...
>I have an aspx page which contains a frameset.

I want to set the location.href of the frames dynamically using
javascript created in the Page_Load of the frameset using
RegisterStartupScript, but the registered script doesn't appear to
run. Is there some reason why RegisterStartupScript won't work in a
aspx page containing a frameset?

When you view the html source of that frameset page as it was received by
the browser, do you see the javascript there?

Just a wild guess: will javascript work in a frameset page? (I expect
it does, but you never know ...)

Hans Kesting


Aug 29 '07 #4
"BillE" <be****@datamti.comwrote in message
news:uh**************@TK2MSFTNGP06.phx.gbl...
The problem is that when I attempt to insert javascript using
RegisterStartupScript in a frameset page the javascript is not created.
Please show your code.
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Aug 29 '07 #5
"Joey" <jo*********@topscene.comwrote in message
news:11*********************@r29g2000hsg.googlegro ups.com...
I would also set the XHTML doctype to frameset, instead of
transitional. I believe you are supposed to do that when using frames.
Yes, that's correct.

Also, script language=javascript is deprecated syntax and not
XHTML-compliant - is this instead:

<script type="text/javascript">

or, even better, get ASP.NET to inject the script tags automatically:
http://msdn2.microsoft.com/en-us/lib...8y(VS.80).aspx
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Aug 29 '07 #6
I'll do that.

Apparently, however, RegisterStartupScript won't work in frameset pages
because there is no <formtag, according to the post from "marss".

Thanks!
Bill

"Mark Rae [MVP]" <ma**@markNOSPAMrae.netwrote in message
news:uM**************@TK2MSFTNGP02.phx.gbl...
"Joey" <jo*********@topscene.comwrote in message
news:11*********************@r29g2000hsg.googlegro ups.com...
>I would also set the XHTML doctype to frameset, instead of
transitional. I believe you are supposed to do that when using frames.

Yes, that's correct.

Also, script language=javascript is deprecated syntax and not
XHTML-compliant - is this instead:

<script type="text/javascript">

or, even better, get ASP.NET to inject the script tags automatically:
http://msdn2.microsoft.com/en-us/lib...8y(VS.80).aspx
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Aug 29 '07 #7

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

Similar topics

2
by: COHENMARVIN | last post by:
Folks, I wrote a simple javascript script, but it doesn't work. First I have a web page that uses frames: ===================== <html> <frameset rows="10%,90%"> <frame src="frame1.htm"...
11
by: Fred | last post by:
I have an aspx page: Main.aspx which has several components that cause a postback. In the page Main.aspx I also have an iframe which contains a multi-page pdf file. The problem I am facing is...
3
by: Lukman | last post by:
Hi, Could you tell me about what is RegisterStartupScript, I try to understand from MSDN sample, but I still don't understand. Could you give me more simple sample ? and what is the purpose of...
6
by: Bill Jones | last post by:
I'm trying to use this.RegisterStartupScript to add some javascript to and aspx page that will run when the page is loaded. Does anyone know if this function only works in the Page_Load function? ...
11
by: Stan Sainte-Rose | last post by:
Hi, I m working on a user control. I need to use a Js file, I would like to know how to load the js file using RegisterStartupScript command from the user control. Also, if I load the same user...
2
by: Guadala Harry | last post by:
I have a frameset aspx page that enables users to upload photos. One frame/page shows a thumbnail list of prevously-uploaded images, and the other frame/page includes the controls that enable...
1
by: Jaime Stuardo | last post by:
Hi all... I have an ASPX page that is part of a frameset whose Page_Load method contains this simple code: RegisterStartupScript("test", "<script>alert('hola');</script>") When I debug, I...
17
by: Rob R. Ainscough | last post by:
Again another simple concept that appears NOT to be intuitive or I'm just stupid. I've read the WROX book and the example doesn't actually show how the .master page links in the other content...
3
by: MJP | last post by:
I have a button which kicks off the generation of a report after which the file will be downloaded. The report generation can take a long time, so client side onclick event of the button also...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.