473,379 Members | 1,335 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,379 software developers and data experts.

Calling JavaScript from C#

Hi,

How can I call JavaScript from C#?

I've create a Window User Control, that I put on ASP.NET
site as Object tag. Now, while some function from my
control is being proceed I need to call a JavaScript
function that is on the site (same as my control).

Best Regards,
Jakub Gutkowski

Nov 15 '05 #1
3 13910
You have a couple options here:
Registerstartupscript or
insert it into the stream
Response.write("<script>function blah blah blah

regards

--
-----------
Got TidBits?
Get it here: www.networkip.net/tidbits
"Jakub Gutkowski" <ja*************@op.pl> wrote in message
news:05****************************@phx.gbl...
Hi,

How can I call JavaScript from C#?

I've create a Window User Control, that I put on ASP.NET
site as Object tag. Now, while some function from my
control is being proceed I need to call a JavaScript
function that is on the site (same as my control).

Best Regards,
Jakub Gutkowski

Nov 15 '05 #2
Are you asking how to make server-side code interact with
client-side code? What exactly are you trying to do?
What you're asking is technically impossible, but there
may be achievable ways to reach the same result..

JER
-----Original Message-----
Hi,

How can I call JavaScript from C#?

I've create a Window User Control, that I put on ASP.NET
site as Object tag. Now, while some function from my
control is being proceed I need to call a JavaScript
function that is on the site (same as my control).

Best Regards,
Jakub Gutkowski

.

Nov 15 '05 #3
I'm trying to make smth. like Java Applet. I read that Windows User Control
on the web site is running on client site, not like Web User Control which
is running in server mode.

I need to create a User Control which can be accessible from JavaScript, and
can call JavaScript from itself. In Java Applet there was a package
Netscape.JScript which contain a JSObject which can access JavaScript on
client site.

At now, I've got Windows User Control, which functions I can call from
JavaScript, but I don't have an idea how to call a JavaScript function from
my control.

Best Regards,

Jakub G.

"Jerry Negrelli" <je************@nospamdatascientific.com> wrote in message
news:05****************************@phx.gbl...
Are you asking how to make server-side code interact with
client-side code? What exactly are you trying to do?
What you're asking is technically impossible, but there
may be achievable ways to reach the same result..

JER

Nov 15 '05 #4

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

Similar topics

7
by: Julia Briggs | last post by:
Hello World - I admit I'm new to javascript but I've tried for days to find a solution to my problem. Basically I have 3 unique javascript files that do different screen display events that I...
18
by: Simula | last post by:
I am developing an HTML javascript application and I want to preserve state in a way that can be book-marked. I chose HTML anchors as a means of preserving state. When the application changes...
5
by: Krishna | last post by:
Hi all, Can i call my javascript functions from the web controls.Any appropriate site which will be tell more on this will be helpfull. Regards.., Krishna
1
by: desmcc | last post by:
Hi, I am launching a modal dialog through the usual javascript (window.showmodaldialog). When the modal dialog is complete (ie user selects OK), the calling page then refreshes itself by setting...
4
by: Martin Feuersteiner | last post by:
Dear Group I'm using VB to write an aspnet application. I would like to call a javascript function from within a VB Sub or VB Function, is it possible? My code is something like this: VB...
13
by: ukrbend | last post by:
I'm new to Javascript and to html and am trying to make the following code snippet work but it doesn't. It refuses to call the getPage() function and I always get a 404 error. I know the code is...
3
by: Opa | last post by:
Hi , I have a form with javasript which launches a popup via the showModalDialog() method. I get the dialog to open, now I am trying to first get a reference to the calling form from the popup...
4
by: Adam Smith | last post by:
Hello, How can I call or trigger an external javascript twice in a form? I have <script language="JavaScript" src="country_state.js" name="Country_State"> <script type="text/javascript"...
5
by: Newbie Coder | last post by:
Hello all I have 3 functions in a javacrip file (MyScript.js), which is added to an ASP.NET 2.0 project 1) no right-click 2) no select text (copy...) 3) History.Back()' How do I call...
6
by: Ajit Goel | last post by:
Hi; We have a Javascript function which I have been tasked to move to a CSharp class. This javascript function uses Regular expression extensively. This function has a string input parameter and...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.