Attach event for Toolbar from Server side.

2 posts, 0 answers
  1. siva
    siva avatar
    12 posts
    Member since:
    Feb 2009

    Posted 12 May 2009 Link to this post

    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"");

    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.

    Siva Kumar KB
  2. Bent
    Bent avatar
    38 posts
    Member since:
    Sep 2008

    Posted 22 May 2009 Link to this post

    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...
Back to Top