Solved

How do we call a VBScript / Java Script Function from Code behind (aspx.cs) C# Class?

Posted on 2004-04-07
3
728 Views
Last Modified: 2007-12-19
How do we call a VBScript / Java Script Function from Code behind (aspx.cs) C# Class?
I want to call a VBScript Function (in the ASPX file) from aspx.cs (from a function in class), so that it executes that VBScript Code.
0
Comment
Question by:MrigankaB
3 Comments
 

Accepted Solution

by:
Keeshan earned 50 total points
Comment Utility
add this line in your html:

<script language="javascript" src="msgBox.js"></script>

if you have your script in a file, else

<script language="JavaScript">
                  
function MyFunction()
{....}

then from your code, you can call the javascript you have created.  
Ex.  to open a new window using scripts

Page.RegisterClientScriptBlock("open", "<script language='javascript' for=window event=onload>OpenMyWindow();</script>");


Change the parameters to what is appropriate for your code. (ex. javascript to vbscript, function names, etc.)
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now