you can still use the attributes function and append the javascript to the
particular button. Something like this should work:
//set a pointer to button number 2
ToolbarButton oSchedule = (ToolbarButton)Tools.Items[1];
//append javascript the normal way
oSchedule.Attributes blah blah blah
or you may want to just embed the javascript inside the text of the
particular button on the toolbar. You can do this either thru the above
statement and using
oSchedule.Text = "<onclick = 'somefunction()' span
style="color:brown;Border

utset;">View Rates</span>"
or you can just do it from the text attribute of the toolbar item property
in the designer.
--
Regards,
Alvin Bruney
[ASP.NET MVP
http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here...
http://tinyurl.com/27cok
"Alexander Kaplunov" <> wrote in message
news:%...
> OK, I am using Microsoft.Web.UI.WebControls.ToolbarButton
>
> This control has a ButtonClick event, which is handeled on the server.
> What
> I really need is when this button is clicked to call a javascript function
> on the client side.
>
>
>
> "Scott M." <s-> wrote in message
> news:...
>> Alex,
>>
>> Nearly everything does have an eventhandler (onClick, onLoad, onChange,
>> onBlur, etc.). Your code doesn't tell us what it is you want to do other
>> than show us a server call to a client function. When do you need your
>> client function to fire?
>>
>> "Alexander Kaplunov" <> wrote in message
>> news:...
>> > Not every control has attributes so this won't work in my case.
>> >
>> >
>> > "Scott M." <s-> wrote in message
>> > news:...
>> > > Or, in Page_Load, you can do this:
>> > >
>> > > control.attributes.add(eventHandlerName, clientFunctionToRun)
>> > >
>> > >
>> > > "Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message
>> > > news:...
>> > > > have a look at registerstartupscript or you can just response.write
> it
>> > out
>> > > > if push comes to shove
>> > > >
>> > > > --
>> > > > Regards,
>> > > > Alvin Bruney
>> > > > [ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
>> > > > Got tidbits? Get it here... http://tinyurl.com/27cok
>> > > > "Alexander Kaplunov" <> wrote in message
>> > > > news:%23deHFg$...
>> > > > > Hello,
>> > > > >
>> > > > > I was wondering if there is a way to call a JavaScript function
> from
>> > > > > code-behind. I know that you can add a "onclick" attribute to a
>> button
>> > > but
>> > > > > that is not what I'm looking for. What I'm looking for is
> something
>> > > > > similar
>> > > > > to this:
>> > > > >
>> > > > > Client side:
>> > > > >
>> > > > > function test()
>> > > > > {
>> > > > > alert("Got test!");
>> > > > > }
>> > > > >
>> > > > > Server side:
>> > > > >
>> > > > > public void foo()
>> > > > > {
>> > > > > call_javascript_function("test");
>> > > > > }
>> > > > >
>> > > > > Is there a way to accomplish this?
>> > > > >
>> > > > > Any help is appreciated.
>> > > > > Alex.
>> > > > >
>> > > > >
>> > > >
>> > > >
>> > >
>> > >
>> >
>> >
>>
>>
>
>