how to call javascript from asp .net c# script ?

L

lee

If a certain criteria happens with some data how do I show a
javascript message box to notify the user ?

I don't think I can use a validator control as it's not applicable.


<SCRIPT LANGUAGE="JavaScript">
function onClickJS()
{
window.confirm("data malformed");
}
</SCRIPT>


Thanks,
Hobnob.
 
S

S. Justin Gengo

Lee,

You may want to make the Body tag into a server control and attach the
javascript to that.

I have some sample code on my website, www.aboutfortunate.com, which will
show you how to do so. It's in VB, but it's very simple. You should be able
to port it over without a problem, but if you have questions feel free to
email me. Just search the code library on the site for: "use the body tag as
a server control" or something similar to that and it should pop up as the
first hit.

Sincerely,

--
S. Justin Gengo, MCP
Web Developer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top