473,626 Members | 3,952 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.tx tEditor.value =
document.all.Tr anscription.obj Editor.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(obj ect sender, System.EventArg s e)
at least.
HELP
Nov 17 '05 #1
1 5906
Actually, you CAN have a client-side <OBJECT> tag and a runat=server
attribute. You just use an HTMLGenericCont rol 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 RegisterClientS criptBlock or
RegisterStartup Script (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.tx tEditor.value =
document.all.Tr anscription.obj Editor.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(obj ect sender, System.EventArg s 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
6905
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 a type mismatch. It is positively because of the boolean(java primitive)parameter. It goes fine if I change this parameter to int or String. This inteface has a lot more methods which works fine, it is just the
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 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!!!!!!!!!!!!
0
8420
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 javascript function which is there in the HTML file.I am using VB.NET as the language. Now If I want to execute both these codes I need to click the nodes twice. I had Added the attributes to the treeview. something like this in the Page_load even...
4
1758
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 this: <asp:Button ID="Finish" runat="server" OnClick="sendEmail"> However, in this new web site version, when the button is pressed, to scripts are supose to run. So i replaced the button code with this:
5
2212
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 C# on the server-side and render it to the client because I can't use the IDs of my controls as they are written in the HTML page itself. Rather, I have to use Control.ClientID to get that ID that I can use in the client-side JS. So my...
15
3611
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" and the other listing "Linked Tasks", I have two buttons which in javascript move items from the first list into the second. Then when a user clicks a thrid button I would like to save this data.
4
3868
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 hit login button, my Action class will validate the user information and send his information to the other site by calling .Net web service, so the other site can extract these information. So, in my jsp, I am using Javascript and webservice.htc to...
4
4115
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 hit login button, my Action class will validate the user information and send his information to the other site by calling .Net web service, so the other site can extract these information. So, in my jsp, I am using Javascript and webservice.htc to...
9
3018
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 variable. This all works fine. However, I want it to loop within a javascript function every 5 seconds. The function does other stuff, so looping within this function is essential (I've simplified it in the example below). Any advice would be...
0
8266
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8199
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8638
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8365
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
4092
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4198
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2626
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 we have to send another system
1
1811
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1511
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.