Re: How to Call functions written in javascript file ?

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: rohit (anonymous_at_discussions.microsoft.com)
Date: 01/20/05


Date: Thu, 20 Jan 2005 00:48:52 -0800

In code behind...
Protected WithEvents butsubmit As
System.Web.UI.WebControls.button
In page_load...
butSubmit.Attributes.Add("onclick", "dummyFunc
('abc', 'dec') ")
remove ;

>-----Original Message-----
>the code --->
>*** butSubmit.Attributes.Add("onclick", "dummyFunc
('abc', 'dec'); ") ***
>doesn't work
>
>it's no proble if that change to
>butSubmit.Attributes.Add("onclick", "alert('dummyMsg'); ")
>
>but i really want to how can i called the functions
written in external
>javascript file'
>
>"Eliyahu Goldin" wrote:
>
>> What exactly doesn't work?
>>
>> Eliyahu
>>
>> "Maverick" <Maverick@discussions.microsoft.com> wrote
in message
>> news:040727BC-1148-4EC7-96B2-
1B10A76765CE@microsoft.com...
>> > I want to group all the javascript functions into a
file named MiscFunc.js
>> in
>> > a asp.net project.
>> > ========================================
>> > e.g. In MiscFunc.js
>> > function dummyFunc(var1, var2)
>> > {
>> > alert(var1 + var2);
>> > }
>> > ========================================
>> >
>> > This javascript function will be called when a asp
button is clicked.
>> > ========================================
>> > butSubmit.Attributes.Add("onclick", "dummyFunc
('abc', 'dec'); ")
>> > ========================================
>> >
>> > and i've already added statement in the following in
the <head> block of
>> HTML
>> > ========================================
>> > <script language="javascript"
src="MiscFunc.js"></script>
>> > ========================================
>> >
>> > Of coz, the code i stated above does not work anyway.
>> > Do anyone of you knows how to make it work ?
>> > thx
>>
>>
>>
>.
>


Quantcast