Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

calling a javascript function

Status
Not open for further replies.

seanbo

Programmer
Jun 6, 2003
407
GB
i am writing an aspx page using c#. i want to call a javascript function called 'displayMessage'. i have added the function to the aspx. how do i call it from within the c# code? i tried this.displayMessage("myMessage"), but it can't find the method.

____________________________________________________
If you like a post, show you care by giving it a <censored>.
 
yes. what i actually want to do is put a message box on the screen. i can't find anything in the asp.net api to do it, so i thought i'd write a javascript function that uses alert. where do i have to put this function?

____________________________________________________
If you like a post, show you care by giving it a <censored>.
 
Nobody answered my question about ASCX files and same as yours. I think we need to use jscript alert function and make our control (like a Button) know this java script function by adding a c# code like
Button1.Attributes.add(&quot;onclick&quot;,&quot;javascript:myAlert()&quot;);
as I saw on some messages on the forum.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top