473,404 Members | 2,137 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,404 software developers and data experts.

Running js method on pageload (from usercontrol)

I know this must be something simple I am not doing rihgt.

I have a page init method that sets up some javascript
variables etc, all worked well as a straight aspx page.

Now I'd liek to include functionality from this control in
a usercontrol, and it appears if I do <body
onload="initScroller()"> in either my usercontrol or my
parent page... I find that the variables that were
supposed to be initialized never were.

Am I supposed to do anythign special in this case?

eg, registerstartupscript or something? (I thought I could
do all that stuff just as well with straight html+js)

Wes
Nov 18 '05 #1
1 1619
not 100% sure I understand what you are doing, but try:
Page.RegisterStartupScript("InitControl", "<script language='javascript'>" &
System.Environment.NewLine & "initScroller();" & System.Environment.NewLine
& "</script>")

Karl

"Weston Weems" <ww****************@gmail.com> wrote in message
news:4f****************************@phx.gbl...
I know this must be something simple I am not doing rihgt.

I have a page init method that sets up some javascript
variables etc, all worked well as a straight aspx page.

Now I'd liek to include functionality from this control in
a usercontrol, and it appears if I do <body
onload="initScroller()"> in either my usercontrol or my
parent page... I find that the variables that were
supposed to be initialized never were.

Am I supposed to do anythign special in this case?

eg, registerstartupscript or something? (I thought I could
do all that stuff just as well with straight html+js)

Wes

Nov 18 '05 #2

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

Similar topics

3
by: Tee | last post by:
Hi, I have a usercontrol with a overridable/virtual method. On the usercontrol onload, it will call this method. Now I have a form that have a few of this usercontrol. And I want to override...
4
by: ATS | last post by:
BUG/PRODUCTION-DOWN: UserControl running from HTML not working. Someone please help, I have a production down situation. For whatever reason, UserControls are not owkring from HTML/IE. When...
5
by: GB | last post by:
Okay, here is what I am trying to do We have a dialog of windows that collects information for generation of a dynamic HTML report. The last page in the wizard dialog accepts all report options...
0
by: Andreas Klemt | last post by:
Hello, I have many UserControls and I want to find out in my Page_Load from which UserControl a Button is fired. How do I do this? Thanks in advance, Andreas
1
by: Ben Fidge | last post by:
As the Web UserControl class has no DesignMode property (it's not derived from Component), how do you tell if your UserControl is running in the IDE. I've got a public property on my UserControl...
2
by: Fernando Lopes | last post by:
Hi. How can I access a method in the code behind of a user control from the code behind of a page or in the code behind of another usercontrol. I change the method to public and now I access from...
0
by: Matt Howeson | last post by:
I have a problem with a usercontrol that is dynamically loaded, from a web control and is not restoring it's viewstate properly. Here's the scenario. Within our content management system, I have...
2
by: USNET | last post by:
I need to add a method to a user control that can be called from another usercontrol. Adding the method is not difficult and its already done. However, the problem is that the method is not...
1
by: jrobbins | last post by:
<asp:ObjectDataSource ID="statusDataSource" runat="server" TypeName="datamanager" SelectMethod="GetReferenceData"> <SelectParameters> <asp:Parameter Name="Level" Type="int32" DefaultValue='0'/>...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
0
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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...

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.