I originally posted this in the RadToolbar forum and then moved it here after realizing it is related to all of the above. In short, the solution as described above in this thread is not working with VS2008 and .NET 3.5.
______________________________________________________
I have a RadToolbar on a charting user control. I have javascript
within the control that attaches client-side events to the toolbar.
Since moving to VS 2008 I am getting a "Negating the minimum value of a
twos complement number is invalid." error. I don't know if this was
ignore before and VS 2008 is breaking on the error now?
Here is my code:
<script type="text/javascript"> |
// On page load add a "end request" Microsoft AJAX event handler. |
var ajaxManager = Sys.WebForms.PageRequestManager.getInstance(); |
ajaxManager.add_endRequest(chartPanel_OnEndRequest); |
|
// Bind script events on page load. |
bindClientEvents(); |
|
// Client events must be bound on each ajax refresh. |
function chartPanel_OnEndRequest(sender, arguments) |
{ |
bindClientEvents(); |
} |
|
// Bind the toolbar to its event handlers. |
function bindClientEvents() |
{ |
// THIS LINE THROWS THE ERROR. toolbar.ClientID is highlighted by the IDE. |
<%= toolbar.ClientID %>.attachEvent("OnClientClick", "toolbarClickHandler"); |
} |
In this particular case, the toolbar has Visible = False. So it makes
sense that the toolbar doesn't exist on the page and that may be what
is causing the weird error. I replaced the bindClientEvents() logic
with this:
// Bind the toolbar to its event handlers. |
function bindClientEvents() |
{ |
var findToolbar = document.getElementsByName('<%= toolbar.ClientID %>'); |
|
if (findToolbar.length > 0) |
{ |
findToolbar(0).attachEvent("OnClientClick", "toolbarClickHandler"); |
} |
} |
However, it didn't help. The same error now occurs on the getElementsByName line.
Any suggestions?
Thank you,
Terry