Solved

Button CLick with JavaScript and VB code

Posted on 2013-05-10
2
451 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 27

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

758 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now