JavaScript, C# and Windows User Control problem

  • Thread starter Thread starter Jakub Gutkowski
  • Start date Start date
J

Jakub Gutkowski

Hi,



Dose anybody knows how to call JavaScript function in C# Windows User
Control?



I use Windows User Control as smth like ActiveX, 'coz I need to call
functions from my User Control from JavaScript - same as You can do it with
ActiveX (just put objectId dot and name of function). But know, one of my
functions in User Control need do call a javascript function, which is
placed on aspx site.



I reed about Registerstartupscript and is not what I want, i need smth. like
JSObject in Java Applet, it is possible to do it in C#? can I call from my
User Control placed on the site a javascript function placed on same site?



Best regards,

Jakub G.



Ps.: Alvin B. - sorry, I cant find my last post so I could replay for you
post.
 
Dose anybody knows how to call JavaScript function in C# Windows User

I had the same problem some time ago and ended up doing something like this:

//in my activex/applet.
public String TellMeWhatToDo()
{
return "alert('hi there!');";
}

// in my javascript
eval(myobject.TellMeWhatToDo());

Petter
 
I was thinking about that, but this solution don't satisfy
me :( My object
have to return a string representation of Boolean value
("true" or "false"),
so I can't return a script, especially when not only my
Object require him,
there are others JavaScript functions which call him.

..NET Framework must have some kind of functions, class
which will solve my
problem; I just can't believe that, creators of .NET
Framework haven't
include some helpful class to solve this little problem :(

Best regards,

Jakub G.
 
Back
Top