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

Moving Javascript to Code behind

0 Answers 67 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, 05:13 AM
Hi
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">
<items>
<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" />
</items>
</rad:radtoolbar>

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;
}
}

No answers yet. Maybe you can help?

Tags
ToolBar
Asked by
siva
Top achievements
Rank 1
Share this question
or