Solved

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

Posted on 2004-04-07
3
741 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
ID: 10803998
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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

778 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