473,499 Members | 1,765 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Calling a javascript function from server script URGENT HELP

Ok I am about to pull my hair.
I have an active x control in an object tag which, as you
know cant have runat=server. So what I need is to not
loose what is in this box everytime a postback happens. So
all I want to do is add this statement
document.all.txtEditor.value =
document.all.Transcription.objEditor.textrtf;
in the before the page is posted so that I can then
retrive it and put it back.
WHY CANT I DO THIS!!!!!!!!!!!!
I have tried all kinds of things, the submit function is
not getting called when the postback occurs.
There has to be a way how to call a javascript function
from the server side code. Where I can put this in the
private void Page_Unload(object sender, System.EventArgs e)
at least.
HELP
Nov 17 '05 #1
1 5888
Actually, you CAN have a client-side <OBJECT> tag and a runat=server
attribute. You just use an HTMLGenericControl in your CodeBehind to work
with it.

While you can't CALL a JavaScript function from the server side, you can
certainly ADD one to the Page, using RegisterClientScriptBlock or
RegisterStartupScript (if you want the script to run immediately after the
page is loaded).

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Big things are made up of
lots of little things.

"Silvia Brunet-Jones" <sb***********@hotmail.com> wrote in message
news:35****************************@phx.gbl...
Ok I am about to pull my hair.
I have an active x control in an object tag which, as you
know cant have runat=server. So what I need is to not
loose what is in this box everytime a postback happens. So
all I want to do is add this statement
document.all.txtEditor.value =
document.all.Transcription.objEditor.textrtf;
in the before the page is posted so that I can then
retrive it and put it back.
WHY CANT I DO THIS!!!!!!!!!!!!
I have tried all kinds of things, the submit function is
not getting called when the postback occurs.
There has to be a way how to call a javascript function
from the server side code. Where I can put this in the
private void Page_Unload(object sender, System.EventArgs e)
at least.
HELP

Nov 17 '05 #2

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

Similar topics

2
6880
by: Eyal | last post by:
Hey, I would appriciate if anyone can help on this one: I have a java object/inteface having a method with a boolean parameter. As I'm trying to call this method from a javascript it fails on...
0
380
by: Silvia Brunet Jones | last post by:
Ok I am about to pull my hair. I have an active x control in an object tag which, as you know cant have runat=server. So what I need is to not loose what is in this box everytime a postback...
0
8412
by: rahulkate | last post by:
Hello Everybod I have a problem hope you can help me out I have a treeview and on the selectedindexchange event of the treeview I want to execute some code from the vb codebehind file and a...
4
1742
by: Miguel Dias Moura | last post by:
Hi, I just uploaded a web site and i am getting an error. I have a script which sends form values to an email using AspNetEmail. The script was working when i was calling the script like...
5
2200
by: Alex Maghen | last post by:
I frequently find myself wanting to insert some basic client-side JavaScript functions in the page of an ASPX of mine. But I find it so frustrating that I have to actually contruct my JavaScript in...
15
3590
by: mc | last post by:
I'm writing an app for managing Task Lists, I'm trying to add some controls to a form that I can use to link tasks, my original intention was to: - Add two list boxes, one listing "all Tasks"...
4
3858
by: gengyue | last post by:
Hi, I need to call .Net webservice from my JSP page. My application is Struts application. It is deployed on Oracle application server. Here is the whole process. I have a login form. When user...
4
4106
by: gengyue | last post by:
Hi, I need to call .Net webservice from my JSP page. My application is Struts application. It is deployed on Oracle application server. Here is the whole process. I have a login form. When user...
9
3005
by: mrcheeky | last post by:
Hi, I'm stuck, but it's almost working! From a html page, my javascript calls a server-side php script. The php reads a value from a server-side .txt file and passes it back as a javascript...
0
7128
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
7006
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
7169
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
7215
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
7385
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
5467
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4917
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
3088
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
661
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.