Solved

Button CLick with JavaScript and VB code

Posted on 2013-05-10
2
457 Views
Last Modified: 2013-05-13
I have a button that on click I want to (modify an )use this Javascript with a yes no confirm that (len) records are being deleted
function getit() {
    var grid = $find("<%= rgQueue.ClientID %>");
    var len = grid.get_masterTableView().get_dataItems().length;
    alert(len);
}

Open in new window


If confirm = OK

Then let the VB code run
    Private Sub rbCancelList_Click(sender As Object, e As System.EventArgs) Handles rbCancelList.Click
        Dim a As ArrayList = GetTelerikGridSelections(rgQueue)
        'do something with the ArrayList
    End Sub

Open in new window

0
Comment
Question by:lrbrister
2 Comments
 
LVL 28

Accepted Solution

by:
Ark earned 500 total points
ID: 39160303
'server
rbCancelList.OnClientClick = "getit()"
Private Sub rbCancelList_Click(sender As Object, e As System.EventArgs) Handles rbCancelList.Click
        Dim a As ArrayList = GetTelerikGridSelections(rgQueue)
        'do something with the ArrayList
    End Sub

'client
function getit() {
    var grid = $find("<%= rgQueue.ClientID %>");
    var len = grid.get_masterTableView().get_dataItems().length;
    return confirm( 'delete ' + len + ' records?');
}
0
 

Author Closing Comment

by:lrbrister
ID: 39161099
Thanks
0

Featured Post

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question