Moving Javascript to Code behind

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

    Posted 12 May 2009 Link to this post

    I am using Rad tool bar in my code and the javascript is in aspx page.  I want to move that code to either Code behind or to other Javascript file.  But when i tried copying code to code behind its giving error.  The event is not firing..

    This is how i am using the Code and I want to move the javascript to Code behind.  

    <rad:radtoolbar AutoPostBack="true" runat="server" id="tbStudentRequirement" skin="office2007" UseFadeEffect="True">
    <rad:radtoolbarbutton Width="75px" ID="tbbtnEdit" AccessKey="i" Tooltip="Edit(Alt+I)" CommandName="Edit" ButtonImage="Edit.gif" ButtonText="Edit" Hidden="False" runat="server" DisplayType="textImage" />

    Javascript in aspx page

    <script language="javascript" type="text/javascript"> 

    <%= tbDebtRequirement.ClientID %>.attachEvent("OnClientClick","ToolBarEvents");

    function ToolBarEvents(sender, e)
    if (sender.CommandName == "Edit")
     if (!CheckComplexItemforEdit("Student"))
    return false;
    EditPopUp("ManageStudent.aspx?ID=" + document.getElementById("selectedID").value,"wndManageStudent");
    return false;
Back to Top