Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

how to write javascript inside c#(URGENT)

Posted on 2004-04-02
3
3,951 Views
Last Modified: 2007-12-19
my javascript doesnt work inside c# using asp.net anyone have a verygood example using javascript inside a c# class its very urgent
thanx alot
0
Comment
Question by:loopholes
3 Comments
 
LVL 2

Accepted Solution

by:
pippothegreat earned 500 total points
ID: 10743823
im also doing this
heres the code i know how it feels to be in a hurry so ill give you something easy and working.

String strJava = "<script language=JavaScript> ";
        strJava += "do your coding here (everything that was in double quotes are now in single)"      
    strJava += "</";        <-----make sure that its in two seperate lines
    strJava += "script>";  <-----""

        if(!this.IsStartupScriptRegistered("Startup"))
      this.RegisterStartupScript("Startup", strJava);
0
 

Author Comment

by:loopholes
ID: 10744148
thanks alot pippothegreat i need this badly
0
 

Expert Comment

by:trubes1244
ID: 10919381
Is it possible to put this code in a class file?
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…

840 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