How to use javascript in .ascx pages
+4
A:
You can add script tags to the markup:
<script language="javascript">
// place your javascript here
</script>
<script language="javascript" href="path to js file" />
Or use ScriptManager in the code behind so you don't include the same file/js section multiple times if you use multiple controls in a page.
You can find out more about ScriptManager
here (overview, including usage scenarios).
Oded
2010-09-24 09:42:05
gives error "Error on page".....java script function not called
Asad
2010-09-27 05:00:49
@Asad - Without seeing the JS code and how you have included it, there isn't much information for me to go on.
Oded
2010-09-27 08:12:23