This is a migrated thread and some comments may be shown as answers.

Attach event for Toolbar from Server side.

1 Answer 94 Views
ToolBar
This is a migrated thread and some comments may be shown as answers.
siva
Top achievements
Rank 1
siva asked on 12 May 2009, 06:53 AM
Hi
For Rad toolbar the following lines of code is used in aspx page to attach the event onClientClick.  Please can u tell me how we can move this line of code into server side i.e, aspx.cs file?

<script language="javascript" type="text/javascript"> 
<%= tbDebtRequirement.ClientID %>.attachEvent(""OnClientClick"",""ToolBarEvents"");
</Script>

I tried the following in Code behind(.cs) file. But it does not work..

 string sJscript = "";
 sJscript = @"'<%= tbDebtRequirement.ClientID %>'.attachEvent(""OnClientClick"",""ToolBarEvents"");";
this.ClientScript.RegisterStartupScript(typeof(Page), "jj", sJscript, false);

This wont give any javascript error but the event will not get fired.

Thanks
Siva Kumar KB

1 Answer, 1 is accepted

Sort by
0
Bent
Top achievements
Rank 2
answered on 22 May 2009, 10:04 AM
It seems like your are doing things the wrong way (are you coming from the "Classic" controls version?).
One piece of advice would be to read the docs. The client-side api docs are very thorough, so perhaps you should try doing things the way they were intended instead of trying to do stuff that's not correct (or _I_ don't understand why you are doing at least).

PS: Even though attachEvent won't fail, it's not the way the control works... Once again: read the docs (hint: "toolBar.add_buttonClicked")...

Hope that helps...
Tags
ToolBar
Asked by
siva
Top achievements
Rank 1
Answers by
Bent
Top achievements
Rank 2
Share this question
or